Skip to content

Commit

Permalink
fix(form): duplicated form needs a different name
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Aug 22, 2019
1 parent 09363d5 commit 404232b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,16 @@ public function duplicate() {
if ($new_form_id === false) {
return false;
}
$newForm = new self();
$newForm->getFromDB($new_form_id);
$newName = $newForm->fields['name'] . ' [' . __('Duplicate', 'formcreator') . ']';
$newForm->update([
'id' => $new_form_id,
'name' => Toolbox::addslashes_deep($newName),
]);
$linker->linkPostponed();


return $new_form_id;
}

Expand Down

0 comments on commit 404232b

Please sign in to comment.