diff --git a/src/Form/Type/TemplateType.php b/src/Form/Type/TemplateType.php index 8d88d4e7..a510a928 100755 --- a/src/Form/Type/TemplateType.php +++ b/src/Form/Type/TemplateType.php @@ -10,13 +10,13 @@ namespace BitBag\SyliusCmsPlugin\Form\Type; -use Symfony\Component\Form\AbstractType; +use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; -final class TemplateType extends AbstractType +final class TemplateType extends AbstractResourceType { public function buildForm(FormBuilderInterface $builder, array $options): void { diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index cd35c3b3..e438cbd5 100755 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -15,6 +15,7 @@ parameters: bitbag_sylius_cms_plugin.form.type.collection.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.media.validation_groups: "%bitbag_validation_group%" + bitbag_sylius_cms_plugin.form.type.template.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.uploader.filesystem: bitbag_sylius_cms_plugin_media jms_serializer: diff --git a/src/Resources/config/services/form.xml b/src/Resources/config/services/form.xml index af46ec53..fa0c38b2 100644 --- a/src/Resources/config/services/form.xml +++ b/src/Resources/config/services/form.xml @@ -77,6 +77,8 @@ + %bitbag_sylius_cms_plugin.model.template.class% + %bitbag_sylius_cms_plugin.form.type.template.validation_groups% diff --git a/src/Resources/config/validation/Template.xml b/src/Resources/config/validation/Template.xml new file mode 100644 index 00000000..9972c09c --- /dev/null +++ b/src/Resources/config/validation/Template.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + +