From 5db7e681db53c540bd886afcd87d33b1f4bb0539 Mon Sep 17 00:00:00 2001 From: Luke Stewart Date: Thu, 24 Nov 2022 10:19:20 +1300 Subject: [PATCH] Detect and handle bad data contact_sub_type = 0 in d7 source --- src/EventSubscriber/WebformCivicrmMigrateSubscriber.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/EventSubscriber/WebformCivicrmMigrateSubscriber.php b/src/EventSubscriber/WebformCivicrmMigrateSubscriber.php index 4a9f390..a24d8b5 100644 --- a/src/EventSubscriber/WebformCivicrmMigrateSubscriber.php +++ b/src/EventSubscriber/WebformCivicrmMigrateSubscriber.php @@ -359,6 +359,9 @@ public function migrateWebformElementCiviCRMContact(array $element,array $d7_for } } } + if (empty($element['#contact_sub_type'])) { + unset($element['#contact_sub_type']); + } return $element; }