diff --git a/Form/Extension/AttachmentAclExtension.php b/Form/Extension/AttachmentAclExtension.php new file mode 100644 index 00000000..39038474 --- /dev/null +++ b/Form/Extension/AttachmentAclExtension.php @@ -0,0 +1,30 @@ +getData(); + if (($data['importexport']['source'] ?? null) === 'akeneo') { + $builder->get('attachment')->get('acl_protected')->setDisabled(false); + } + } + } + + public static function getExtendedTypes(): iterable + { + return [ConfigType::class]; + } +} diff --git a/Resources/config/services.yml b/Resources/config/services.yml index e5ee425b..f03ebcdb 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -39,6 +39,11 @@ services: tags: - { name: form.type_extension, extended_type: Oro\Bundle\IntegrationBundle\Form\Type\ChannelType } + oro_akeneo.form.extension.attachment_acl_extension: + class: 'Oro\Bundle\AkeneoBundle\Form\Extension\AttachmentAclExtension' + tags: + - { name: form.type_extension, alias: oro_entity_config_type, extended_type: Oro\Bundle\EntityConfigBundle\Form\Type\ConfigType } + oro_akeneo.form.extension.product_type: class: Oro\Bundle\AkeneoBundle\Form\Extension\ProductTypeExtension arguments: