Edit Profile Quirk

Re: [Rusty] Edit Profile Quirk

By Jason - December 17, 2010

Hi Rusty,

That's an interesting problem. Was the "Undefined Index" warnings coming from sample_profile.php or from your included files? Was it stopping the other files from returning records?

My first thought would be that the other included files are not using
'allowSearch' => false,

Which means they'll be looking for variables inside the $_REQUEST array to perform a search with. The code you reference will insert the variable "num" into the $_REQUEST array which is a unique record number for any given section. This is probably what was throwing everything else off.

You could add this to the code:

// prepopulate form with current user values
foreach ($CURRENT_USER as $name => $value) {
if (array_key_exists($name, $_REQUEST) || $name=="num") { continue; }
$_REQUEST[$name] = $value;
}


This will stop "num" from getting into the $_REQUEST array.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Edit Profile Quirk

By Rusty - December 17, 2010 - edited: December 17, 2010

Ahh, I see exactly what you're saying there. You are correct yet again! And yes indeed the errors were coming from my pages/table calls, NOT from within the form itself.

I'll do some further comparison / sandboxing this weekend to try figure out why or what it is unique about this configuration of code structure/sequence/ordering.

I am aware that at this point, I'm more or less like a bull (with an elevated IQ) in a china shop in relation to me & the CMS Builder code - and I'm not saying that CMSB is fragile, just that I can screw up anything. But then again, I usually break things in the process of figuring them out [angelic]
Rusty

Re: [Jason] Edit Profile Quirk

By Rusty - December 17, 2010 - edited: December 17, 2010

Hi Rusty,

That's an interesting problem. Was the "Undefined Index" warnings coming from sample_profile.php or from your included files? Was it stopping the other files from returning records?

My first thought would be that the other included files are not using
'allowSearch' => false,

Which means they'll be looking for variables inside the $_REQUEST array to perform a search with. The code you reference will insert the variable "num" into the $_REQUEST array which is a unique record number for any given section. This is probably what was throwing everything else off.

You could add this to the code:

// prepopulate form with current user values
foreach ($CURRENT_USER as $name => $value) {
if (array_key_exists($name, $_REQUEST) || $name=="num") { continue; }
$_REQUEST[$name] = $value;
}


This will stop "num" from getting into the $_REQUEST array.

Hope this helps.


I tried dumping in JUST the bit of code in red and I still got the following error, but when I combined it with the 'allowSearch' => false, for each of my other sections that I'm trying to call up it works perfectly. Thanks guys, for the always awesome support.
Rusty