Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Apr 12, 2024
1 parent 1de016c commit 59ba4df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion inc/deployaction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/Deploy/DeployUserinteractionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 59ba4df

Please sign in to comment.