Details
-
Bug
-
Resolution: Done
-
Medium
-
4.6.9
-
None
-
Yes
Description
TaxonomyEntryAssignmentFormTypeMapper passes all options provided in the config to the FormType. Most mappers don't do this, they only passes on the options that the FormType actually supports. The exception is GenericFormTypeMapper when $mergeOptions parameter is used, ie:
- integer
- select
- the activity_log block (Ibexa\Bundle\ActivityLog\Form\Type\ObjectClassChoiceType)
- Users block (Ibexa\AdminUi\Form\Type\UserChoiceType)
The other mappers only passes on the options that the FormType actually supports.
final class TaxonomyEntryAssignmentFormTypeMapper implements AttributeFormTypeMapperInterface { public function map(...) { $definitionOptions = $blockAttributeDefinition->getOptions(); $options = []; (...) return $formBuilder->create( 'value', AttributeTaxonomyEntryAssignmentListType::class, $options, );
The current implementation prevents the use of custom options that are handled in custom code.
So, the following config will cause exception due to the current implementation.
vtaxonomy: name: VTaxonomy category: default thumbnail: 'bundles/ibexafieldtypepage/images/thumbnails/embed.svg' views: default: { name: 'Default block layout', template: '@ibexadesign/blocks/vtaxonomy.html.twig', priority: -255 } attributes: taxonomy_entry_assignment_list: type: taxonomy_entry_assignment_list name: Tags options: taxonomy: tags foobar_attribute: true