OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Validation constraints not being applied

This topic contains 16 replies, has 3 voices, and was last updated by  Mike Kudelya 7 years, 2 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #34238

    adamlundrigan
    Participant

    I have an entity CourseOffering which has a schedule attached (OneToMany of CourseOfferingTime entities). I want to ensure that (a) there is at least one CourseOfferingTime in the collection, and (b) that the start < end on each CourseOfferingTime.

    CourseOffering#schedule:

    CourseOfferingTime class:

    CourseOfferingType::buildForm contents:

    CourseOfferingScheduleEntryType::buildForm contents:

    validation.yml:

    But none of the constraints are enforced on the client side or on the server side. (eg: if I add an empty CourseOfferingTime to the form I get a DB constraint violation because start is null, whereas I expect to get a form validation error).

    Any thoughts or advice on what I’ve missed in setting up the validation?

Viewing 16 replies (of 16 total)
  • Author
    Replies
  • #34254

    Mike Kudelya
    Participant

    Hi

    Yes, of course it is a bad idea, but you can override some platform parts in /src directory. Here i described how it works.

Viewing 16 replies (of 16 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top