Skip to content

Commit

Permalink
Fix missing user translations validation
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolabssas committed Mar 11, 2019
1 parent 7d0a2a8 commit 14eb8ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Cocorico/CoreBundle/Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down
7 changes: 7 additions & 0 deletions src/Cocorico/UserBundle/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
/** @Ignore */
'label' => false,
'constraints' => array(new NotBlank()),
'required' => true,
'attr' => array(
'placeholder' => 'auto'
)
Expand Down
2 changes: 1 addition & 1 deletion src/Cocorico/UserBundle/Resources/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 14eb8ef

Please sign in to comment.