Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox rendering not working after cloning #13

Open
bobbingwide opened this issue Jul 15, 2023 · 2 comments
Open

Checkbox rendering not working after cloning #13

bobbingwide opened this issue Jul 15, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jul 15, 2023

Detected after cloning content from s.b/oikcom, the logic to render the checkbox field, which uses the rendering for select, doesn't produce the expected results.
We see the following Notice

Notice: Undefined index: a:1:{i:0;s:3:”red”;} 
in /home/customer/www/oik-plugins.co.uk/public_html/wp-content/plugins/acf-field-block/includes/class-acf-field-block-renderer.php 
on line 446

phpMyAdmin shows the values being stored as below.

meta_id post_id meta_key meta_value
393844 49098 checkbox a:1:{i:0;s:3:"red";}
393892 49098 select red

In actual fact, updating the field in the ACF metabox didn't appear to survive the round trip.

image

@bobbingwide
Copy link
Owner Author

In the servers the post meta value showed that the field had been serialized twice.
This is the output when the checkboxes selected are red and amber and the meta data has been cloned.

s:36:"a:2:{i:0;s:3:"red";i:1;s:5:"amber";}";

the value should be

a:2:{i:0;s:3:"red";i:1;s:5:"amber";} 

@bobbingwide
Copy link
Owner Author

In actual fact, updating the field in the ACF metabox didn't appear to survive the round trip.

This red herring was a side effect of having the Checkbox field in two field groups with the field having the same name due to it being part of a clone field type. When editing the post meta you have to edit the last of the fields with the same key.
This is a known feechur of ACF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant