Skip to content

Commit a086a29

Browse files
committed
Fix an import form issue when updating an existing form, where notifications weren’t being treated correctly
1 parent e571620 commit a086a29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/helpers/ImportExportHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ public static function createFormFromImport(array $data, ?Form $form = null): Fo
238238
$emailTemplate = ArrayHelper::remove($notificationData, 'emailTemplate');
239239
$pdfTemplate = ArrayHelper::remove($notificationData, 'pdfTemplate');
240240

241-
$notification = new Notification();
241+
// Find or create the notification, based on the form and notification handle
242+
$notification = Formie::$plugin->getNotifications()->getFormNotificationByHandle($form, $notificationData['handle']) ?? new Notification();
243+
242244
$notification->setAttributes($notificationData, false);
243245

244246
if ($emailTemplate) {

0 commit comments

Comments
 (0)