Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » UPDATE1 scrolling skips validation after SubmitNext
UPDATE1 scrolling skips validation after SubmitNext [message #5891] Sat, 24 September 2016 18:40 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Noticed that when using UPDATE1 on multiple selection of records, when you click Submit+Next for a record, the framework moves on to the next record but somehow does not call validateUpdate for the GET request of that next record. Without such validation, submit button will be shown for certain records that otherwise should have been hidden and GET stage validation errors will be missing. The problem can be traced back to std.update1.inc, the part of the code which processes the GET request:
   // get data from the database
        if (isset($no_getdata) AND is_True($no_getdata)) {
            // returning from a script that does not want any pending changes to be lost
        } else {
            $fieldarray = $dbobject->getData($where);
            $fieldarray = $dbobject->getExtraData($fieldarray);
            $result = $dbobject->validateUpdate($fieldarray);
        } // if
Turns out that when the previous record was submitted, $no_getdata was set to true. Thus, bypassing getData, getExtraData and validateUpdate calls for the next record. Not exactly sure what the objective was other than what was mentioned in the comment "does not want any pending changes to be lost". I assumed that validation should not result in pending changes being lost, so I solved the problem by moving the validateUpdate call like this:
   // get data from the database
        if (isset($no_getdata) AND is_True($no_getdata)) {
            // returning from a script that does not want any pending changes to be lost
        } else {
            $fieldarray = $dbobject->getData($where);
            $fieldarray = $dbobject->getExtraData($fieldarray);
        } // if
        $result = $dbobject->validateUpdate($fieldarray);

[Updated on: Sat, 24 September 2016 18:43]

Report message to a moderator

Re: UPDATE1 scrolling skips validation after SubmitNext [message #5892 is a reply to message #5891] Sun, 25 September 2016 05:03 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
Thanks for spotting that. I shall include it in the next release.

Previous Topic: getCount function throws error when sql statement starts with whitespace
Next Topic: SQL Server @@IDENTITY
Goto Forum:
  


Current Time: Thu Apr 18 12:17:56 EDT 2024

Total time taken to generate the page: 0.00978 seconds