Support

Account

Home Forums Bug Reports Illegal string offset 'acf_fc_layout' on Flexible Content

Unread

Illegal string offset 'acf_fc_layout' on Flexible Content

    • ggedde

    • February 22, 2020 at 2:34 pm

    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.
    Like

    
    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;
    

    Thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.