Dear Sir/Madam,
I have two custom posts Class and Student with Intermediary post type custom fields, some of the fields are mandatory, I create a relationship form without changing any setting, I can submit the data without filling the mandatory but it passes and save the post.
How can I change the field as a mandatory field from the expert mode?
Best regards,
Kelvin.
Hello, I was not able to reproduce this problem in a simple test on my local site. It is not possible to create new posts from the Post Relationship panel if required fields are left empty. Can you tell me if this content was created by clicking "Add new User" or "Connect existing User"? Does the problem occur in both scenarios?
Is it okay for me to add some test content to try to reproduce the problem on your site?
Dear Christian Cox,
I do it using the relationship form, I think it should be 'Connect existing User'
You can test it from hidden link
Best regards,
Kelvin.
Okay thank you for the additional information. I am able to replicate this problem for required date fields in M2M relationship field groups. If there is more than one required field in the intermediary field group, field validation is broken in the relationship form. If you turn the preserve console log feature in the browser you will see a JavaScript error during form submission:
main.js?ver=2.6.10:326 Uncaught TypeError: Cannot read property 'length' of undefined
at c.validateString (main.js?ver=2.6.10:326)
at c.validate (parsley.min.js?ver=2.9.1:1)
at w.validate (parsley.min.js?ver=2.9.1:1)
at b._validateConstraint (parsley.min.js?ver=2.9.1:1)
at parsley.min.js?ver=2.9.1:1
at Function.map (jquery.min.js?ver=3.6.0:2)
at Array.<anonymous> (parsley.min.js?ver=2.9.1:1)
at Function.each (jquery.min.js?ver=3.6.0:2)
at b.whenValid (parsley.min.js?ver=2.9.1:1)
at b.whenValidate (parsley.min.js?ver=2.9.1:1)
This error is preventing form validation as expected, and form submission is happening despite missing required field(s). I have escalated this to my 2nd tier support team for further investigation, and I suspect they will need to escalate to our developers for a solution. I'll let you know if a patch or workaround becomes available.