Membership Edit Profile Page Preventing Listings from Displaying

4 posts by 3 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: May 18, 2012   (RSS)

By RGC - May 16, 2012

Hi
I am using the user-profile code that was provided as an example with the Membership Plugin 1.06. I am having an issue when I am using this code on a page which also should be displaying other listings from multi section editors. Something in this code is preventing other multi section editors from displaying. I am pretty certain it has to do with the following foreach statement not ending:

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


What do I need to do to get the other multi section editors to appear?
Rod

Re: [rgc] Membership Edit Profile Page Preventing Listings from Displaying

By robin - May 17, 2012

Hey, could you post the code you're trying to use so we can take a closer look? If you're not comfortable posting the code here you can mail it to:
support@interactivetools.com

Thanks,
Robin
Robin
Programmer
interactivetools.com

Re: [rgc] Membership Edit Profile Page Preventing Listings from Displaying

By Jason - May 18, 2012

Hi,

Does that code appear before the other getRecord calls that aren't working?

The foreach loop you posted will end. What it's doing is taking all of the fields inside $CURRENT_USER and loading them into the $_REQUEST array. This is typically only needed on profile editing pages. However, if this code is executing before other getRecords calls, it could be causing unwanted automatic searches. Basically, if there is a field in $CURRENT_USER that is used in other sections, it would trigger an automatic search.

To stop this, add the
'allowSearch' => false,

option to any getRecords call that doesn't appear to be working.

For example:

list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'allowSearch' => false,
));


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/