I have a problem with the conditional logic after updating to 5.2.6.
I have created a Flexible content field where some fields are hidden based on the select field on the settings tab. For example, I have a slider-field, where it’s possible on the settings tab to select whether to show content on the slide or not.
This used to work but now it’s not respecting the saved settings. If I go to the settings tab and deselect the content and reselect it, the conditional logic is working. However after saving the post the conditional logic is broken again and it is showing only the first item.
There’s no js-errors. The fields are hidden by the class “hidden-by-conditional-logic”.
It would seem that you’ve come across a good olé fashion bug.
I will make a bug report out of this.
To be clear, what’s happening is that a loaded edit screen (or reloaded after an update or save) does not respect the conditional logic when the triggering field is in a different tab within the same field group?
I have come across another instance of conditional logic acting weird on 5.2.6.
Add a stylized multi-select, and then add fields conditionally shown based on the value of the select. After saving, it seems the fields that should show based on the multiselect values disappear. They come back if you add/remove items, but is never shown correctly on first page load.
Version 5.2.5 doesn’t have this bug.
I’m also experiencing some difficulty with the conditional functionality.
I’m using ACF Pro 5.3.1 in WP 4.3.1. (OSX 10.9.5)
The problem seems to have begun after the last update.
Conditional logic was working fine previously. Now the same field groups are not functioning. Depending on certain selections, fields disappear, and/ or become un-editable. I’ve tried rebuilding the field group, reinstalling the plugin, using it in conjunction with another theme and re-installing WordPress. Alas the problem persists.
Any thoughts? Such a grand plugin really….
Elliot here – ACF dev.
I’ve juts done some testing but am unable to replicate the issues mentioned above
Can you please export your field group to .json and attach it to your reply.
I would like to test your exact setup to better replicate the issue
Thanks for the .json attachment. I’ve imported your field group and and tested your conditional logic which worked perfectly as expected for both adding a post and editing one.
It may be possible that your post edit page contains some JS which is conflicting with and preventing ACF from running.
Are you able to setup a blank WP site and import your .json to do some testing. Perhaps you will be able to find the culprit by adding in your plugins / theme one at a time
Thanks for the reply.
Just to confirm – only 1 of your fields contains conditional logic (trade_accepted).
– It should show when ‘trade_offer_type’ is equal to ‘trade’ OR ‘wanted’.
– it should hide when ‘trade_offer_type’ is equal to ‘giveaway’
This is exactly what it does for me. Perhaps you can setup a site online for us both to login and test?
I am using ACF v5.4.6 with a brand new, blank WordPress install (v4.6.1), running the default, twentysixteen theme, and I am having an issue with certain conditional logic as well.
I’ve got a ton of fields on a custom post type, most of which are all conditionally dependent upon one particular field, and all the ones operating off of that conditional rule are working perfectly fine. However, there are two fields who are supposed to be conditionally dependent upon the value of a different field than the others, and I cannot get those two fields to display conditionally no matter what.
I’ve tried disabling the conditionally logic on the field for which these two non-functioning fields are conditionally dependent, and that doesn’t fix the issue. I’ve tried switching the field type to a number of different field types, also with no luck.
Short of deleting these fields and recreating them, hoping that makes a difference for whatever reason (UPDATE: This did nothing), can anyone think of anything else that may be causing this hiccup, when all my other conditional fields are functioning perfectly?
Update: So I was using a radio button field with two possible values, both of which ended with a colon (:). Removing the colons from the values fixed this issue, which I’ve since come to learn is because this field allows you to specify a label and a value per line, separated by a colon. It all makes sense to me now. Sorry for any confusion. Just be careful using colons here folks. Label : Value, results in a blank value if your line ends in a colon. Doy!
Sorry for the late reply. I didn’t receive any notification about your comment. Please note that this is a community forum and if you require any support for a bug, please create a ticket: http://support.advancedcustomfields.com/new-ticket/
I’ve looked at your add trade / edit trade forms and can see the issue. Your ‘add trade’ form works well because the acf-input.js script is being enqueued in the head as it should be. Your ‘edit trade’ form is different, it loads the JS file in the footer which is preventing the conditional logic from being added.
Please be sure to use the acf_form_head() function correctly so that ACF CSS and JS are appended to the ehad, not footer
I didn’t recognize when exactly, but after some update conditional logic was broken.
Now I have installed ACF 5.6.1 and conditional logic seems doesn’t work (or at least doesn’t work in some cases).
It was worked before, but now when I set up to show a particular field for certain values of another field, this particular field is never displayed (for any values of the second field). If I set up to show a particular field when the value of another field is not equal to some given value, then my particular field is always displayed (also for any values of the second field).
An interesting detail: sometimes (in rare cases) conditional logic still works. But in most cases in exactly the same situation (exactly with the same fields) it does not work.
P.S.: I do not have any tabs for these specific fields.
Can you please open a new support ticket and be sure to attach your field group .json export so we can try to replicate the issue?
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!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.