I’ve tested this on three separate websites, it appears that the field validation relating to fields that are conditional AND required is broken on the new version (PRO 5.6.6). When they are hidden, because the condition isn’t met, it still triggers a validation warning.
I’m sometimes also unable or have difficulty toggling between radio fields, and the page seems to load slower than usual, but I’m not sure if that’s just on my end, or related to the above.
The problem isn’t there with the exact same setup, but with the earlier version, 5.6.5.
See attached for the field group I’ve encountered problems with: try the flexible content panels fields on a page, use the first one (content), and try to validate. The panel options tab has required, conditional fields for the background options (colour fill vs. images). Same for the number of columns, there are hidden WYSIWYG fields that want to be validated even though they’re hidden and validation should be skipped. You may need to save the page first, and try to resave it afterwards to get the error to come up.
Thanks for the bug report,
Elliot here – ACF dev.
I’ve just imported your json (thanks for the export!) but am unable to replicate any conditional logic issues. I can add any layouts (including the first “content” layout) and all settings validate correctly.
I can also confirm that the HTML “disabled” attribute is added to the field’s input elements.
Perhaps this is a good place to start. Can you please inspect the field element that is hidden by conditional logic and check if it’s inputs are disabled?
I just tried your testing site but am unable to login. Here is the error message I see (raw HTML message, no WP):
Whoops, something went wrong.
We should be back in a few minutes.
(Error 404 – Not Found)
Can you please take a look at this. I am still not able t replicate this issue, but am aware a few developers are experiencing it.
I just re-read your last comment, and am not a little confused about what the issue is.
You say that you are unable to switch back from “Colour Fill” to “Background Type” because a
I believe this is a CSS issue introduced in the latest version. This can easily be fixed by adding a ‘clear:both’ style attribute to the field.
Is this the issue? I thought you were unable to save a post due to validation errors appearing for fields that are hidden?
Thanks for the reply. Looks like things are working now!
I’ve logged in and can replicate the issue.
This looks like a CSS bug causing the ‘label’ element to float over the top of other fields.
The good news is that this is a super easy fix.
I’ve pushed a hotfix to solve this layout problem. Can you please re-download the plugin and test that it is working?
An easy way to re-download is to edit the main acf.php plugin file and change the version number ‘5.6.6’ down to ‘5.6.5’
– please note the version number appears twice in this file and both will need to be changed
– after this change is made, please update the plugin as per normal and it will update to 5.6.6 (including the new fix)
Keep me posted.
I was experiencing both the CSS issue as well as the validation error issue that other devs have mentioned. Your hotfix seems to have solved the CSS issue though!
To recreate the validation issue, login to that demo website again, then do the following (I’ve greatly simplified the field group for testing):
Go to Pages > Home, then “Add Flexible Panel”, select “Demo Panel”, then add dummy content in the “Content (1)” field (that one is required), then update the page. You’ll see “Validation failed. 3 fields require attention”. Those are hidden, conditional, required fields. To see them, switch “Number of Columns” from 1 to 4. You’ll see Content (2), Content (3), and Content (4), with the validation warning now visible.
Thanks for the reply. This is great!
I can replicate the issue and will get to work on a fix for this too.
It looks like the problem only affects newly added flexible content fields. After toggling a conditional logic trigger, the issue resolves itself.
I’ll do some tests and find how many other field’s this affects
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.