I am using my own flexible content field and I filter it from another select field that is registered to an option page. The is basically a Global Blocks page. The fields are working great within the Admin panel and with in the front end of my website, but because of this I am getting this PHP Warning.
Illegal string offset 'acf_fc_layout' in /var/www/shopbedmart/public_html/wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-flexible-content.php on line 833
Looking at the file and code there is a condition after the variable to check if it exists and if not then continue:
class-acf-field-flexible-content.php on line 833
// get layout name $l = $value[ $i ]['acf_fc_layout']; // bail early if layout deosnt exist if( empty($layouts[ $l ]) ) continue;
In order to get rid of the Warnings which are flooding my log file I think an additional condition should be placed before the $l variable.
if (empty($value[ $i ]['acf_fc_layout'])) continue; // get layout name $l = $value[ $i ]['acf_fc_layout']; // bail early if layout deosnt exist if( empty($layouts[ $l ]) ) continue;
This is not a bug that I have seen. Most of the time these errors are caused by how something else is being done. I would need more information, like more details on how you are constructing this flex field and template code being run when the error happens.
You can also try contacting the developer, but he’d need the same information to try to recreate the error. https://www.advancedcustomfields.com/contact/
If I get time I will do that. Unfortunately, I am no longer on that project and a bit slammed right now, but I will keep it in mind.
@bmostrey Just curious were you experiencing the same issue.
If so, are you doing the same with Flexible fields that I am or something different.
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.