From bc0d50b5c83a9e714e35f614927333e490ce9def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Sat, 3 Dec 2016 09:24:41 +0100 Subject: [PATCH 1/2] Fixed: Wrong parameter usages by setPostedData() method. --- e107_admin/eurl.php | 2 +- e107_handlers/admin_ui.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index 752a9349c..b555ee422 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -312,7 +312,7 @@ class eurl_admin_ui extends e_admin_controller_ui if(isset($_POST['etrigger_save'])) { $this->getConfig() - ->setPostedData($this->getPosted(), null, false, false) + ->setPostedData($this->getPosted(), null, false) //->setPosted('not_existing_pref_test', 1) ->save(true); diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 0846bf3e8..3ff86efa0 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -4091,7 +4091,7 @@ class e_admin_controller_ui extends e_admin_controller if(false === $data) { // we don't wanna loose posted data - $model->setPostedData($_posted, null, false, false); + $model->setPostedData($_posted, null, false); return false; } if($data && is_array($data)) @@ -4142,7 +4142,7 @@ class e_admin_controller_ui extends e_admin_controller // Scenario I - use request owned POST data - toForm already executed - $model->setPostedData($_posted, null, false, false) // insert() or update() dbInsert(); + $model->setPostedData($_posted, null, false) // insert() or update() dbInsert(); ->save(true); @@ -5090,7 +5090,7 @@ class e_admin_ui extends e_admin_controller_ui $this->convertToData($_POST); - $model->setPostedData($_POST, null, false, false) + $model->setPostedData($_POST, null, false) ->setParam('validateAvailable', true) // new param to control validate of available data only, reset on validate event ->update(true); @@ -5480,7 +5480,7 @@ class e_admin_ui extends e_admin_controller_ui /* $this->getConfig() - ->setPostedData($this->getPosted(), null, false, false) + ->setPostedData($this->getPosted(), null, false) //->setPosted('not_existing_pref_test', 1) ->save(true); */ From 8aa724b09d8b277e1be00da7e288dc121eab8d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=B3na=20Lore?= Date: Sat, 3 Dec 2016 12:45:53 +0100 Subject: [PATCH 2/2] Let _manageSubmit() method save posted values. --- e107_handlers/admin_ui.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 3ff86efa0..6280d01e1 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -5090,9 +5090,11 @@ class e_admin_ui extends e_admin_controller_ui $this->convertToData($_POST); - $model->setPostedData($_POST, null, false) - ->setParam('validateAvailable', true) // new param to control validate of available data only, reset on validate event - ->update(true); + $model->setPostedData($_POST, null, false); + $model->setParam('validateAvailable', true); // new param to control validate of available data only, reset on validate event + // Do not update here! Because $old_data and $new_data will be the same in afterUpdate() methods. + // Data will be saved in _manageSubmit() method. + // $model->update(true); if($model->hasError()) {