From 14eb8ef5d7cb5c5d961e6fdbca298fb86346f929 Mon Sep 17 00:00:00 2001 From: cocolabssas <18029169+cocolabssas@users.noreply.github.com> Date: Mon, 11 Mar 2019 12:59:54 +0100 Subject: [PATCH] Fix missing user translations validation --- src/Cocorico/CoreBundle/Resources/config/config.yml | 4 ---- src/Cocorico/UserBundle/Entity/User.php | 7 +++++++ .../UserBundle/Form/Type/ProfileAboutMeFormType.php | 1 - src/Cocorico/UserBundle/Resources/config/config.yml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Cocorico/CoreBundle/Resources/config/config.yml b/src/Cocorico/CoreBundle/Resources/config/config.yml index 68e5cd72e..012643b45 100644 --- a/src/Cocorico/CoreBundle/Resources/config/config.yml +++ b/src/Cocorico/CoreBundle/Resources/config/config.yml @@ -9,10 +9,6 @@ imports: - { resource: "../../../../../vendor/knplabs/doctrine-behaviors/config/orm-services.yml" } framework: - validation: - enabled: true - enable_annotations: true -# api: 2.5-bc assets: base_urls: - '%cocorico.assets_base_urls%' diff --git a/src/Cocorico/UserBundle/Entity/User.php b/src/Cocorico/UserBundle/Entity/User.php index 64fef869c..409eb35d7 100644 --- a/src/Cocorico/UserBundle/Entity/User.php +++ b/src/Cocorico/UserBundle/Entity/User.php @@ -66,6 +66,13 @@ class User extends BaseUser implements ParticipantInterface use ORMBehaviors\Translatable\Translatable; use ORMBehaviors\Sluggable\Sluggable; + /** + * Fix missing validation on translations fields + * @Assert\Valid + */ + protected $translations; + + const PERSON_TYPE_NATURAL = 1; const PERSON_TYPE_LEGAL = 2; diff --git a/src/Cocorico/UserBundle/Form/Type/ProfileAboutMeFormType.php b/src/Cocorico/UserBundle/Form/Type/ProfileAboutMeFormType.php index 12ba8b3cb..3663de4fd 100644 --- a/src/Cocorico/UserBundle/Form/Type/ProfileAboutMeFormType.php +++ b/src/Cocorico/UserBundle/Form/Type/ProfileAboutMeFormType.php @@ -65,7 +65,6 @@ public function buildForm(FormBuilderInterface $builder, array $options) /** @Ignore */ 'label' => false, 'constraints' => array(new NotBlank()), - 'required' => true, 'attr' => array( 'placeholder' => 'auto' ) diff --git a/src/Cocorico/UserBundle/Resources/config/config.yml b/src/Cocorico/UserBundle/Resources/config/config.yml index 89bb9d850..3a620832b 100644 --- a/src/Cocorico/UserBundle/Resources/config/config.yml +++ b/src/Cocorico/UserBundle/Resources/config/config.yml @@ -34,7 +34,7 @@ fos_user: name: user_resetting profile: form: - type: user_profile + type: Cocorico\UserBundle\Form\Type\ProfileAboutMeFormType name: user_profile validation_groups: [CocoricoProfile]