Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow validation on nested relational values through parent validation settings #16744

Open
ananth3087 opened this issue Dec 7, 2022 · 1 comment

Comments

@ananth3087
Copy link

ananth3087 commented Dec 7, 2022

Describe the Bug

When we configure the validation for child data model from parent data model using validation tab and then its not working in latest version ( 9.21.2), but it was working in old version like 9.10.0.

Note: I dont want to configure the validation in Child data modal because i planned to create multiple relationship field with same Child data modal, so each time, i will use different validation rules, so Parent is the better place to configure it.

  • I have created two entity such as Parent and Child.
  • I have related the Parent and child using Many to many relationship.

Parent Entity with Many to many relationship with child:

image

Child Entity:

image

In parent, we child field (many to many field), and then there is a validation tab in which i have configure the validation for field in child, but its not working.

image

In following screenshot, you can see that i'm able to create child with empty title

image

image

To Reproduce

We can use latest version above 9.12 to reproduce this issue.

  • I have created two entity such as Parent and Child.
  • I have related the Parent and child using Many to many relationship.

Parent Entity with Many to many relationship with child:

image

Child Entity:

image

In parent, we child field (many to many field), and then there is a validation tab in which i have configure the validation for field in child, but its not working.

image

In following screenshot, you can see that i'm able to create child with empty title

image

image

Errors Shown

No response

What version of Directus are you using?

9.21.2

What version of Node.js are you using?

18.12

What database are you using?

sQLite

What browser are you using?

Chrome

How are you deploying Directus?

locally

@JonathanDoelan
Copy link

Same here. Tried to validate files’ mime-type to only allow images … not possible :(

@rijkvanzanten rijkvanzanten changed the title Validation for related field are not working in latest version Allow validation on nested relational values through parent validation settings Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

5 participants