[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.
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?
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.
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.
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?
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.
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.
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.
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.