UPDATE1 scrolling skips validation after SubmitNext [message #5891] |
Sat, 24 September 2016 18:40 |
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
|
|
|
|