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

Home » RADICORE development » Bug Reports » Delete 1 displays incomplete data upon error
Delete 1 displays incomplete data upon error [message #5611] Tue, 07 June 2016 17:26 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
In Radicore v1.94, setup a Delete 1 task that involves _cm_getForeignData() to obtain data from other related objects and display to the user before deletion.

Upon pressing the submit button in such Delete 1 task, if the deletion turns out unsuccessful due to validation conditions, error messages from the object's $this->errors will be displayed with the submit button removed. That is all working and fine, but you will notice that the data displayed now is quite different from what was shown on the screen just before the submit button was pressed. It appears that all the pieces of information that were gathered by _cm_getForeignData have now disappeared from the screen.

Upon closer look we see in std.delete1.inc that the getExtraData call (which eventually invokes _cm_getForeignData) is conditional on $errors being empty:

...
$scrolling[$dbobject->getClassName()]['where']    = $where;

// if ($_SERVER['REQUEST_METHOD'] == 'GET') {
if (empty($errors)) {
    // get any extra data and merge with $fieldarray
    $fieldarray = $dbobject->getExtraData($fieldarray);
    if ($dbobject->errors) {
    	$errors = $dbobject->getErrors();
    } // if
} // if

if (empty($errors)) {
...

Hence, resulting in incomplete data being displayed upon deletion error. So, I would like to suggest to get rid of the condition and change this code to:

...
$scrolling[$dbobject->getClassName()]['where']    = $where;

// if ($_SERVER['REQUEST_METHOD'] == 'GET') {

// get any extra data and merge with $fieldarray
$fieldarray = $dbobject->getExtraData($fieldarray);
if ($dbobject->errors) {
     $errors = $dbobject->getErrors();
} // if

if (empty($errors)) {
...

[Updated on: Tue, 07 June 2016 21:10]

Report message to a moderator

Re: Delete 1 displays incomplete data upon error [message #5615 is a reply to message #5611] Wed, 08 June 2016 09:25 Go to previous message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
That change works, so I will include the updated script in the next release.

Previous Topic: List 1 Object Calls
Next Topic: Radicore v1.95 - Postgresal 9.5.3 - System crash after pressing submit button
Goto Forum:
  


Current Time: Thu Mar 28 19:04:59 EDT 2024

Total time taken to generate the page: 0.00946 seconds