Skip to content

Commit 404232b

Browse files
committed
fix(form): duplicated form needs a different name
1 parent 09363d5 commit 404232b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

inc/form.class.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,16 @@ public function duplicate() {
15411541
if ($new_form_id === false) {
15421542
return false;
15431543
}
1544+
$newForm = new self();
1545+
$newForm->getFromDB($new_form_id);
1546+
$newName = $newForm->fields['name'] . ' [' . __('Duplicate', 'formcreator') . ']';
1547+
$newForm->update([
1548+
'id' => $new_form_id,
1549+
'name' => Toolbox::addslashes_deep($newName),
1550+
]);
15441551
$linker->linkPostponed();
15451552

1553+
15461554
return $new_form_id;
15471555
}
15481556

0 commit comments

Comments
 (0)