Viewerfuncion POST BUG
2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 8, 2010 (RSS)
By (Deleted User) - October 8, 2010
Hi,
I think i found a bug in viewerfunction.php
The history is:
I had a page with a php code to send an email and say "thank you" to the user.
The "thank you" message supose to be from a field in the CMS, but it never showed this message.
So i discover that, when you are posting data (POST method) to a page, inside this page the LIST function doesn´t work! It cant find any records...
So i had to make a direct access using the php mysql funcionts... and i could get the field value.
I think i found a bug in viewerfunction.php
The history is:
I had a page with a php code to send an email and say "thank you" to the user.
The "thank you" message supose to be from a field in the CMS, but it never showed this message.
So i discover that, when you are posting data (POST method) to a page, inside this page the LIST function doesn´t work! It cant find any records...
So i had to make a direct access using the php mysql funcionts... and i could get the field value.
Re: [lexmooze] Viewerfuncion POST BUG
By Chris - October 8, 2010 - edited: October 8, 2010
Hi lexmooze,
I suspect this probably happened because getRecords() was trying to do a search on some of the data that you POSTed. By default, the 'allowSearch' feature will filter records using form input - any form field names that match up with record field names will be used to filter your records.
This feature makes it very easy to build search pages, but it can also confusingly cause records not to show up!
Try adding the line below in red to your getRecords() call:
Does that help? Please let me know if you have any questions.
I suspect this probably happened because getRecords() was trying to do a search on some of the data that you POSTed. By default, the 'allowSearch' feature will filter records using form input - any form field names that match up with record field names will be used to filter your records.
This feature makes it very easy to build search pages, but it can also confusingly cause records not to show up!
Try adding the line below in red to your getRecords() call:
list($sampleRecords, $sampleMetaData) = getRecords(array(
'tableName' => 'sample',
'allowSearch' => false,
));
Does that help? Please let me know if you have any questions.
All the best,
Chris
Chris