From 4c4f4b5ca7b7bf17e7841cd8cadb4a01d5b856d5 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 5 Apr 2018 15:23:29 +0200 Subject: [PATCH] fix deprecations: use fqcn --- Controller/CustomFieldController.php | 7 +++++-- Form/Type/ChoicesListType.php | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Controller/CustomFieldController.php b/Controller/CustomFieldController.php index f43bf8819..8c8e969f9 100644 --- a/Controller/CustomFieldController.php +++ b/Controller/CustomFieldController.php @@ -4,9 +4,12 @@ namespace Chill\CustomFieldsBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; + use Chill\CustomFieldsBundle\Entity\CustomField; use Chill\CustomFieldsBundle\Form\CustomFieldType; + /** * CustomField controller. * @@ -62,7 +65,7 @@ class CustomFieldController extends Controller 'group_widget' => ($entity->getCustomFieldsGroup()) ? 'hidden' :'entity' )); - $form->add('submit', 'submit', array('label' => 'Create')); + $form->add('submit', SubmitType::class, array('label' => 'Create')); return $form; } @@ -154,7 +157,7 @@ class CustomFieldController extends Controller 'group_widget' => 'hidden' )); - $form->add('submit', 'submit', array('label' => 'Update')); + $form->add('submit', SubmitType::class, array('label' => 'Update')); return $form; } diff --git a/Form/Type/ChoicesListType.php b/Form/Type/ChoicesListType.php index c272834c8..95ab982df 100644 --- a/Form/Type/ChoicesListType.php +++ b/Form/Type/ChoicesListType.php @@ -5,6 +5,8 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; @@ -26,10 +28,10 @@ class ChoicesListType extends AbstractType $locales = $this->defaultLocales; $builder->add('name', TranslatableStringFormType::class) - ->add('active', 'checkbox', array( + ->add('active', CheckboxType::class, array( 'required' => false )) - ->add('slug', 'hidden', array( + ->add('slug', HiddenType::class, array( )) ->addEventListener(FormEvents::SUBMIT, function(FormEvent $event) use ($locales){