Skip Navigation

[Escalated to 2nd Tier] Mandatory skipped from relationship form

This support ticket is created 2 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 2 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#2136833
Screenshot 2021-08-08 at 7.38.39 PM.png
Screenshot 2021-08-08 at 7.39.02 PM.png

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.

#2138081

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?

#2142153
Screenshot 2021-08-13 at 11.54.33 PM.png

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.

#2143071

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.