diff --git a/src/lib/Form/Type/Content/BaseContentType.php b/src/lib/Form/Type/Content/BaseContentType.php index 9dd6242..84c5a01 100644 --- a/src/lib/Form/Type/Content/BaseContentType.php +++ b/src/lib/Form/Type/Content/BaseContentType.php @@ -68,11 +68,17 @@ public function configureOptions(OptionsResolver $resolver) { $resolver ->setRequired(['languageCode', 'mainLanguageCode', 'struct']) - ->setDefault('struct', static function (Options $options, $value) { + ->setDefault('struct', static function (Options $options, ?ContentStruct $value) { if ($value !== null) { return $value; } + trigger_deprecation( + 'ibexa/content-forms', + 'v4.6', + 'The option "struct" with null value is deprecated and will be required in v5.0.' + ); + return $options['contentUpdateStruct'] ?? $options['contentCreateStruct'] ?? null; @@ -101,20 +107,6 @@ public function configureOptions(OptionsResolver $resolver) 'ibexa/content-forms', 'v4.6.4', 'The option "%name%" is deprecated, use "struct" instead.' - ) - ->setNormalizer( - 'struct', - static function (Options $options, ?ContentStruct $value): ?ContentStruct { - if ($value === null) { - trigger_deprecation( - 'ibexa/content-forms', - 'v4.6', - 'The option "struct" with null value is deprecated and will be required in v5.0.' - ); - } - - return $value; - } ); } }