Skip to content

Commit 772fecd

Browse files
committed
fix(target_actor,change_actor): fix duplciation
when duplciated, id to questions is not updated and points to the question of the source form, not the duplicate form
1 parent 378050d commit 772fecd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inc/form.class.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,9 @@ public function duplicate() {
15641564
unset($tta_row['id'],
15651565
$tta_row['uuid']);
15661566
$tta_row['plugin_formcreator_targettickets_id'] = $new_target_item_id;
1567+
if (in_array($tta_row['actor_type'], ['question_person', 'question_group', 'question_supplier','question_actors'])) {
1568+
$tta_row['actor_value'] = $tab_questions[$tta_row['actor_value']];
1569+
}
15671570
if (!$target_ticket_actor->add($tta_row)) {
15681571
return false;
15691572
}
@@ -1587,6 +1590,9 @@ public function duplicate() {
15871590
unset($tca_row['id'],
15881591
$tca_row['uuid']);
15891592
$tca_row['plugin_formcreator_targetchanges_id'] = $new_target_item_id;
1593+
if (in_array($tca_row['actor_type'], ['question_person', 'question_group', 'question_supplier','question_actors'])) {
1594+
$tca_row['actor_value'] = $tab_questions[$tca_row['actor_value']];
1595+
}
15901596
if (!$target_change_actor->add($tca_row)) {
15911597
return false;
15921598
}

0 commit comments

Comments
 (0)