Support

Account

Home Forums Bug Reports advanced_custom_fields_pro/api/api-value.php

Solved

advanced_custom_fields_pro/api/api-value.php

  • maybe we found a bug in “advanced_custom_fields_pro/api/api-value.php”.

    line 264:

    $value = apply_filters( “acf/load_value/name={$field[‘_name’]}”, $value, $post_id, $field );

    we changed to:

    $value = apply_filters( “acf/load_value/name={$field[‘name’]}”, $value, $post_id, $field );

    line 310:

    $value = apply_filters( “acf/format_value/name={$field[‘_name’]}”, $value, $post_id, $field );

    we changed to:

    $value = apply_filters( “acf/format_value/name={$field[‘name’]}”, $value, $post_id, $field );

    … to get it working (probably copy paste mistake). (v. 5.5.6) ACF Pro.

  • $field['_name'] holds the actual name of the field. In the case of repeater and other sub fields $field['name'] holds a modified field name that is equal to the meta_key value that the field will be stored as. This is not a bug.

  • Same here, after last update (5.5.5 -> 5.5.6) repeater started throwing “advanced_custom_fields_pro/api/api-value.php line 264” errors.
    But that happens only when I export code of my fields and load it from my functions.php.
    If I don’t export code and just load fields from ACF, there’s no error.
    In 5.5.5 there was no error both ways.

  • Then there could be a bug for fields in PHP. I did not look closely at the code, sorry, I was going by what I happen to know that array index is used for, now that I’m looking at it closer I might be completely wrong.

    It appears that this is entirely new code added for recent issue brought up with post preview.

  • We have opened a ticket for this issue.

    Currently trying to provide access for the ACF support team to our development servers.

    Can confirm that the error occurs with a new WP installation:
    Twenty Seventeen Theme
    Clean install of ACF Pro > updated to 5.5.6
    Error only appears to occur for us when Fields are exported as Php and included via PHP
    Fields are also being displayed on an Options Page

  • Hi guys

    I’ve spent the morning debugging this issue and believe to have found a solution.
    The issue seems to occur only when registering a field group via PHP.
    Can you please copy the attached local.php file into your ‘acf-pro/core’ folder and let me know if this solves the issue​​​​​

  • Thanks elliot > that appear to have done the trick… error warnings have disappeared > we will keep you updated as testing continues

    ## UPDATE

    Three sites updated with the new local.php file, and tested – all error warnings have disappeared and fields are returning correct data

    ## Update 5.5.7

    Three development sites updated to ACF Pro 5.5.7
    Two standard sites
    One Multisite

    All sites are working as expected

  • Updated to 5.5.7, working fine, thanks!

  • Updated local.php works, thanks Elliot. Yes we register the fields via php (and load the plugin from within the theme folder).

  • This issue is happening for us with WP_DEBUG turned on.

    Wordpress 4.8 with ACF 5.5.14, has anyone else had a re-occurrence of this issue?

    Also does anyone know what the problem was when fields are being declared in PHP as all of the ACF fields we use are declared within PHP so leaning towards this possibly being part of the issue.

    The values are still being output to page so when wp_debug is not outputting to page you do not know its happening but as we develop themes / plugins with this setting turned on we would like to get to the bottom of the problem.

  • Hi @gsc89

    Thanks for the bug report.
    Can you please open a support ticket with a clear description of the issue.
    Please be sure to include any relevant code / .json files:
    https://support.advancedcustomfields.com/new-ticket/

    Thanks
    Elliot

  • Hi Elliot,

    I already opened one a couple days ago, sorry I was looking to see it was a known issue rather than a bug / or if anyone else had the issue and had resolved it.

    I will wait to hear back from the support ticket open. (Open with a James)

    Regards,
    Sam.

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

The topic ‘advanced_custom_fields_pro/api/api-value.php’ is closed to new replies.