Since the most recent update (22.214.171.124) some of my fields are no longer working.
I have a bunch of different fields defined as for instance the following:
not required, no default value, no conditional logic
(i know btw this is a silly way of using checkboxes, but it’s a legacy thing from before acf…)
since the update, new entries for this type of field no longer register, ie. checking the checkbox, will not create or update a custom field by the name of video although going back to the admin page the checkbox appears checked.
i am stumped. i can provide a login url in a private message.
I’m also having issues with checkboxes that default to
checked. My fields are implemented via PHP, so if
'default_value' => 1 then the field always appears checked on edit screens, and if the associated post is saved, the field is cleared/removed from postmeta (though I should note that the hidden
_name meta remains).
Testing shows that defaulting the field to
unchecked (i.e. 0) allows the field to display and store the data properly.
After a quick test, I can’t replicate the issue at all.
The value ‘1’ is saving perfectly as a default value and as a normal selection.
Is it possible that you have another field with the name field_name on the edit screen? This would cause the value to be overridden.
Is it also possible that some sort of PHP error is occurring which is stopping ACF from saving completely?
Yes, the checkbox field saves it’s data as an array. This is becuase they may be multipl values selected or 1.
This way, the returned value is always an array which makes the front end code easier to use (don’t have to ask if it is or isnt an array – lots of noob devs had issues with this)
Yes, the flip side to this is that the checkbox field is not good for creating a connection, but when you think about it, if you want to make a connection to another post, you only want 1 value, not multiple, so you should be using the select field instead.
Are you able to use the select field?
The topic ‘Checkboxes no longer working’ 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.