Skip Navigation

[Resolved] When required field is empty, content can still be saved without error or notice

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user was still able to save new posts even if the required fields were not entered.

Solution:
We have found the cause of the issue and produced a patch that you can apply on your website. Please download the following zip https://toolset.com/patches/validation.js.zip
Then extract the file "validation.js" file to "types/vendor/toolset/toolset-common/toolset-forms/js/"

You will need to purge the browser cache to make sure it will use this patched file.

If this patch did not land on the next release, you will need to apply it again, manually.

This support ticket is created 3 years, 2 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 21 replies, has 3 voices.

Last updated by wimD-2 3 years ago.

Assisted by: Jamal.

Author
Posts
#2195653

Hi,

I have a custom content types with several fields that are required. When I (or any other user) add(s) content and press save or update, there is no notice or error to say that the required field is empty. You can save the content without a problem, hich defeats the purpose of the reired field. Could you have a look at this?

Best regards,
Wim

#2195759

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share problem URL and admin access details where I can see the issue and in addition to that please share information that what fields you make required.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2201275

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thank you for sharing staging site but could you please share problem URL where I can see the issue?

I tried to login to the admin access details and when I click on Sessies of events => All items it does not show me the list of Sessies posts.

Can you please confirm how can I access the post?

#2201373

Hi Menish

Here's het link to the overview of the cutsom post type Sessies:
hidden link
You should be able to see all of them. If not, I don't know what might be causing that. I'm seeing everything the way it is supposed to be, so being an admin too, you should as well.

To see the issue regarding the resuired fields, you can create a new sessie, fill in the title and see what happens when you fill in/do not fill in the required fields.

#2201459

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When I try to access the link you shared - it redirect me back on the following URL:
=> hidden link

Maybe there is issue with the grant/permissions to the user you shared.

#2201471

Hi Menish

Can you give it another try? I think the 2FA got in the way there.

Best regards,
Wim

#2201505

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

This is really strange. I see the issue, when I try to create a new post without selecting the required fields, it shows the required field message for one required field but still the post is successfully saved. Please check the following screenshot:
=> hidden link

This is not normal behavior. I see you are using number of third party plugins.

*** Please make a FULL BACKUP of your database and website.***
Could you please try to resolve your issue by deactivating all third-party plugins as well as with the default theme to check for any possible conflicts with any of the plugins or themes? - Do you see any difference?

#2201507

No, it didn't do a thing. With all plugins deactivated except for the toolset plugins and the theme switched to the default Twenty Twenty-one, the issue is still there.

#2201573

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

We have one known issue about that if the post does not include the post content field (post body) then the validation fails. Would you mind to give a go and try workaround offered:
=> https://toolset.com/errata/types-field-validation-fails-if-post-editor-doesnt-include-post-content-section/

If the workaround does not work, I'll require duplicator copy of your site to investigate the issue further. Can you please send me duplicator copy of your site:
https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#2204411

No, the work-around doens't make a change. The issue persists.

I've installed Duplicator, but it does not support multisites (unless I go pro). Any other plugin that works for you?

Best regards,
Wim

#2204725

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've duplicator pro plugin but I do not see I've rights to access the plugins page.

Can you please share full rights so that I should try to install the duplicator pro plugin and see if I'm able to export the site.

#2214245

Hi Minesh

Sorry for my late reply.
You should have the required access to the multi install now.

Thank you for your help in this matter!
Wim

#2214969

Hello Wim! Minesh won't be available for a couple of days. If you don't mind, I'll continue with you on this ticket.

Unfortunately, I was not able to pass through the basic HTTP authentification, I used all the possible combinations from the provided credentials to no avail. Check this screenshot hidden link

I am setting your next reply to be private to let you share the working credentials. Please let me know which ones are for basic HTTP auth and which ones to use for WordPress.

I understand that the validation does not work on the backend, right? I'll be testing with the Sessions custom post type.

#2216987

Hi Jamal

Can you see the previous private message I've sent to Minesh? Everything is there. Two logins and two passwords. If not, please let me know.

Thank you for your help! Best regards,
Wim

#2217431

Hello Wim, these are the credentials that I tried last time, but they did not work. Maybe I mixed them in an incorrect way. Now, I was able to login, and see the issue.

I created a clean test site(Standalone instead of Multisite), and I was able to reproduce this issue for a custom post type that uses the Classic editor. The issue was not reproducible for a custom post type that uses the blocks editor. You can log in to my test site with this URL hidden link
- CPT with the classic editor, which presents the issue: hidden link
- CPT with the blocks editor, does not present the issue: hidden link

I wanted to confirm this on your website. I created a new custom post type that uses the blocks editor, but I can't assign the same Fields Group to it as it contains a Post Reference Field. So, I changed the current post type to use blocks but the issue was still reproducible with it.

Unfortunately, the provided user cannot access the network plugins, it does not have enough permissions. I wanted to Install Duplicator Pro to take a copy of the multisite. Please make the provided user an "super administrator" so I can install the plugin and take the copy.