From 59ba4df449d1379c12004a84ad763b91f333076f Mon Sep 17 00:00:00 2001 From: David Durieux Date: Fri, 12 Apr 2024 07:02:07 +0200 Subject: [PATCH] Fix --- inc/deployaction.class.php | 4 +++- tests/Unit/Deploy/DeployUserinteractionTest.php | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/deployaction.class.php b/inc/deployaction.class.php index 44449c3da..09b5603fe 100644 --- a/inc/deployaction.class.php +++ b/inc/deployaction.class.php @@ -572,6 +572,8 @@ function check_data_from_form() { */ function add_item($params) { //append prepared data to new entry + $id = $params['id']; + unset($params['id']); $new_entry[$params['actionstype']] = $params; //get current order json @@ -581,7 +583,7 @@ function add_item($params) { $data['jobs'][$this->json_name][] = $new_entry; //update order - $errors = $this->updateOrderJson($params['id'], $data); + $errors = $this->updateOrderJson($id, $data); if ($errors == 0) { return true; } diff --git a/tests/Unit/Deploy/DeployUserinteractionTest.php b/tests/Unit/Deploy/DeployUserinteractionTest.php index bd766845e..0c9f267b5 100644 --- a/tests/Unit/Deploy/DeployUserinteractionTest.php +++ b/tests/Unit/Deploy/DeployUserinteractionTest.php @@ -222,11 +222,10 @@ public function testSave_item() { $pfDeployPackage->getFromDBByCrit(['name' => 'test1']); $params = ['id' => $pfDeployPackage->fields['id'], 'index' => 0, - 'userinteractionstype' => 'after', - 'name' => 'My interaction', 'name' => 'interaction 1', 'title' => 'My title', 'text' => 'my text', + 'type' => 'after', 'template' => 1, ]; $interaction->save_item($params);