Many many thanks for the repeater conditional Support!
Unfortunately I’ve found inconsistent behavior. I have reproduced it using the following steps.
1) Create a new field group.
2) Create a radio/select field that has 7 alternatives to choose from (these are subtypes)
3) Create a repeater field with a text subfield. This subfield has the conditional “if type is 1 or 2 or 3 or 4 or 6 or 7”.
4) Save the field group.
5) Then look for the conditional rules of the subfield.
Expected: the rules are still the same.
Actual behavior: some rules are missing.
I can confirm that on my local install, I can create a text sub field which contains tall 7 conditional logic rules from the 7 radio button choices…
I would try on a clean install. You may find that the issue was more to do with a server limit on how many variables can be posted at one time.
Hope that helps.
Ok, I resolved this. Couple of things to try – Ensure that the order of conditionals is correct, I had mine a bit messed, was adding an item in the middle instead of appending it to the end. I also increased the max_input_vars tp 6000 and threw the max_input_nesting_level to 10000.. I cannot say if they made a difference, I have limited time to test, I’m fairly confident that its the order that caused it to remove conditionals…
Many thanks! Updating ACF & ACF Repeater solved the issue.
However, there is a little visual glitch: the margin-top of .acf-button-add.add-row-before needs to recalculated each time that the conditional display changes (right now, the plus sign “create a new repeating element” jumps up and down), not only on mousenter of the row.
Thanks again for the UI bug. I have found and fixed this issue. All that was needed was to trigger a ‘mouseover’ event when a sub field was conditionaly hidden / revealed.
I have pushed the fix to the repeater field repo, so you can re-download the add-on to get this code fix.
I won’t release this as a new version just yet, I will wait to bundle some more fixes.
The topic ‘Conditionals of Subfield disappear on save’ is closed to new replies.
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.