diff --git a/src/models/FieldLayoutTab.php b/src/models/FieldLayoutTab.php index d9d8a90a200..d6d900e8e17 100644 --- a/src/models/FieldLayoutTab.php +++ b/src/models/FieldLayoutTab.php @@ -281,6 +281,12 @@ public function setElements(array $elements): void if (is_array($layoutElement)) { try { $layoutElement = $fieldsService->createLayoutElement($layoutElement); + if ($layoutElement instanceof CustomField) { + // check if the underlying field exists + // if not, it should be caught by FieldNotFoundException + // and not added to the tab's elements + $field = $layoutElement->getField(); + } } catch (FieldNotFoundException) { // Skip quietly continue;