diff --git a/src/Factory/FieldFactory.php b/src/Factory/FieldFactory.php index 70d6f95b4f..209be5eae5 100644 --- a/src/Factory/FieldFactory.php +++ b/src/Factory/FieldFactory.php @@ -108,6 +108,12 @@ public function processFields(EntityDto $entityDto, FieldCollection $fields): vo $configurator->configure($fieldDto, $entityDto, $context); } + // check again if the field is displayed because this can change in the configurators + if (null !== $currentPage && false === $fieldDto->isDisplayedOn($currentPage)) { + $fields->unset($fieldDto); + continue; + } + foreach ($fieldDto->getFormThemes() as $formThemePath) { $context?->getCrud()?->addFormTheme($formThemePath); }