Skip to content

Commit

Permalink
fix(target_actor,change_actor): fix duplciation
Browse files Browse the repository at this point in the history
when duplciated, id to questions is not updated and points to the question of the source form, not the duplicate form
  • Loading branch information
btry committed Jul 5, 2019
1 parent 378050d commit 772fecd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,9 @@ public function duplicate() {
unset($tta_row['id'],
$tta_row['uuid']);
$tta_row['plugin_formcreator_targettickets_id'] = $new_target_item_id;
if (in_array($tta_row['actor_type'], ['question_person', 'question_group', 'question_supplier','question_actors'])) {
$tta_row['actor_value'] = $tab_questions[$tta_row['actor_value']];
}
if (!$target_ticket_actor->add($tta_row)) {
return false;
}
Expand All @@ -1587,6 +1590,9 @@ public function duplicate() {
unset($tca_row['id'],
$tca_row['uuid']);
$tca_row['plugin_formcreator_targetchanges_id'] = $new_target_item_id;
if (in_array($tca_row['actor_type'], ['question_person', 'question_group', 'question_supplier','question_actors'])) {
$tca_row['actor_value'] = $tab_questions[$tca_row['actor_value']];
}
if (!$target_change_actor->add($tca_row)) {
return false;
}
Expand Down

0 comments on commit 772fecd

Please sign in to comment.