This topic contains 3 replies, has 2 voices, and was last updated by zhex900 6 years, 6 months ago.
- Topic
Hi,
I have created a custom validation using groups for Contact Entity. My new constraint works, but the validation for individual fields is ignored. NotBlank is not enforced. Did I do something wrong?1234567891011121314#type extensionpublic function setDefaultOptions(OptionsResolverInterface $resolver){$resolver->setDefaults(['data_class' => 'Oro\Bundle\ContactBundle\Entity\Contact','cascade_validation' => true,'validation_groups' =>['contact_info_check']]);}12345678910111213141516171819202122232425262728# validation.ymlOro\Bundle\ContactBundle\Entity\Contact:constraints:- CampusCRM\CampusContactBundle\Validator\Constraints\ContactInfoCheck: { groups: [contact_info_check] }properties:firstName:- NotBlank: ~- Length:max: 100lastName:- NotBlank: ~- Length:max: 100gender:- NotBlank: ~birthday:- Date: ~- LessThanOrEqual:value: now UTCmessage: This value cannot be in the future.emails:- Valid: ~- Oro\Bundle\FormBundle\Validator\Constraints\ContainsPrimary:message: oro.contact.validators.emails.contains_primaryphones:- Valid: ~- Oro\Bundle\FormBundle\Validator\Constraints\ContainsPrimary:message: oro.contact.validators.phones.contains_primary
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.