Support

Account

Home Forums General Issues A non-numeric value encountered in flexible-content.php

Solved

A non-numeric value encountered in flexible-content.php

  • Hello,
    I’m getting these errors in my logs when I load an admin page

    ....
    [Thu Jan 26 07:10:17.145904 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.146111 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.146606 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.147178 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.148349 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.151084 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.151750 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.152213 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.152648 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.153241 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.153449 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.153621 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.154094 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.155379 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.159242 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.160267 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.160796 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.161712 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.161899 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.162078 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.162247 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.163177 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    [Thu Jan 26 07:10:17.163818 2017] [php7:warn] [pid 1090] [client 127.0.0.1:55039] PHP Warning:  A non-numeric value encountered in /var/www/fr/CLIENT_NAME/wp-content/plugins/advanced-custom-fields-pro/pro/fields/flexible-content.php on line 1542
    ...

    I did some debugging around line 1542 in the flexible-content.php file

    $title = '<span class="acf-fc-layout-order">' . ($i+1) . '</span> ' . $title;

    when I var_dump $i, sometimes that value would be the string “acfcloneindex”. I didn’t get too deep into the weeds but it seems like ACF outputs a bunch of hidden fields (assuming for fast loading when the “+” button is hit) and those fields do not have numeric indexes.. I changed that line to:

    $title = (is_numeric($i)) ? '<span class="acf-fc-layout-order">' . ($i+1) . '</span> ' . $title : '<span class="acf-fc-layout-order">1</span> ' . $title;

    and everything seems to work. Not sure if this is a bug or not.

  • Looks like a bug to me, can you open a new support ticket for this here https://support.advancedcustomfields.com/new-ticket/ so that the developer gets the bug report.

  • Submitted, thank you

  • Thanks. This bug is resolved since ACF 5.5.8

  • Hi

    If I understand correctly this is fixed in the pro version, but not for the standalone repeater add-on?

    We are seeing this issue in a project on which I can’t upgrade to pro, and I do still rely on the add-on, as there are no updates for the add-ons anymore I don’t think it will be fixed in there, but would it be possible to guide me in the right direction to solve this issue in my local copy of the plugin?

    Thanks
    Joren

    Update:

    For now I changed the line where the warning happens to the following:

    <td class="order"><?php if(is_numeric($i)) : echo $i+1; endif; ?></td>

    That seems to do the trick, at least for now. But I’m open for better solutions or an update of the add-on plugin 😉

  • You’re best bet would be to submit a bug report to the link I posted before. The addons are being updated. There is a new version of ACF that will be released to WP and the addons will still be available.

    Not sure why you cannot update to pro, the new version (5) when released to the WP repo will likely cause the same issues. Maybe you should start a new topic on any issues you’re having making the move to Pro on this site.

  • Hi John

    Ok, I must have misunderstood, I thought the add-ons didn’t receive any updates anymore.

    Regarding upgrading, it’s not related to ACF or WP but more in the way we are hooked into everything with js etc to make sure a certain flow is followed while creating a post. There wille be a day that we have to do this but our planning for the next releases are to tight to make that happen.

    Joren

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘A non-numeric value encountered in flexible-content.php’ is closed to new replies.