Help! Edit Profile exhibits erratic behavior

5 posts by 2 authors in: Forums > CMS Builder
Last Post: July 13, 2010   (RSS)

Re: [affinitymc] Help! Edit Profile exhibits erratic behavior

By Jason - July 13, 2010

Hi,

If you could send me a link to your site, I can do some testing to see what's happening.

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] Help! Edit Profile exhibits erratic behavior

By affinitymc - July 13, 2010 - edited: July 13, 2010

Thanks Jason,

The site is www.agna.ca


I am also attaching the profile.php file.

Added: In fact the only changes that will be accepted are changes to the password.
Attachments:

profile_002.php 14K

Re: [affinitymc] Help! Edit Profile exhibits erratic behavior

By Jason - July 13, 2010

Hi,

I've taken a look and I think I may see our problem. What's happening is when the user changes a piece of information and submits it, the first thing the script encounters is a "getRecords" statement. CMS Builder then tries to do a search based on all the information they just entered. Since a piece of information was changed, it won't find a record. The message coming up is indicating that no record was found in the database, not that the page itself wasn't found.

The reason the password part works is because of the names of the fields in the form (newpassword1, newpassword2, etc) don't match the names of the fields in the database, so they are dropped from the search.

Fortunately, there is a very easy way to get around this, we just need to add a line to the getRecords statement as follows (I've highlighted the change in red):

list($accountsRecords, $accountsMetaData) = getRecords(array(
'tableName' => 'accounts',
'where' => whereRecordNumberInUrl(1),
'allowSearch' => false,
'limit' => '1',
));


This will stop CMS Builder from performing the search and should let the script run properly. Give that a try and let me know if you run into any other difficulties.

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] Help! Edit Profile exhibits erratic behavior

By affinitymc - July 13, 2010

Thanks Jason! It works perfectly now.