Skip to content

Commit ec40d9f

Browse files
committed
fix: form duplication issue when source form contains access restriction
1 parent 75a1057 commit ec40d9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inc/form.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ public function duplicate() {
12111211
$form_profile = new PluginFormcreatorForm_Profile();
12121212
$tab_questions = [];
12131213

1214-
// From datas
1214+
// From data
12151215
$form_datas = $this->fields;
12161216
$form_datas['name'] .= ' [' . __('Duplicate', 'formcreator') . ']';
12171217
$form_datas['is_active'] = 0;
@@ -1230,7 +1230,7 @@ public function duplicate() {
12301230
unset($row['id'],
12311231
$row['uuid']);
12321232
$row['plugin_formcreator_forms_id'] = $new_form_id;
1233-
if (!$form_validator->add($row)) {
1233+
if (!$form_profile->add($row)) {
12341234
return false;
12351235
}
12361236
}
@@ -1298,6 +1298,7 @@ public function duplicate() {
12981298
return false;
12991299
}
13001300

1301+
// Update the target ticket created while cloning the target
13011302
$update_target_ticket = $target_ticket->fields;
13021303
unset($update_target_ticket['id'], $update_target_ticket['uuid']);
13031304
foreach ($tab_questions as $id => $value) {

0 commit comments

Comments
 (0)