Skip to content

Commit

Permalink
Fix form settings not being set correctly when duplicating a form
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Sep 20, 2024
1 parent bda688f commit af9c9f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/elements/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,9 @@ public function getDuplicateAttributes(): array
$formLayout = unserialize(serialize($this->getFormLayout()));
$this->_clearLayoutIdentifiers($formLayout);

$formSettings = clone $this->settings;
$formSettings->setForm(null);

$notifications = [];

foreach ($this->getNotifications() as $notification) {
Expand All @@ -1913,6 +1916,7 @@ public function getDuplicateAttributes(): array
'title' => Craft::t('formie', '{title} Copy', ['title' => $this->title]),
'formLayout' => $formLayout,
'notifications' => $notifications,
'settings' => $formSettings,
];
}

Expand Down

0 comments on commit af9c9f6

Please sign in to comment.