Support

Account

Home Forums Front-end Issues advanced-custom-fields/core/api.php on line 338

Solving

advanced-custom-fields/core/api.php on line 338

  • i have many error everyday after i upgraded my AFC plugin .
    i have this error :

    wp-content/plugins/advanced-custom-fields/core/api.php on line 338

    i don’t do anything wrong !

  • What is the error you’re getting?

  • [15-Oct-2016 11:16:27 UTC] PHP Catchable fatal error: Object of class WP_Error could not be converted to string in /home/filmhaon/public_html/wp-content/plugins/advanced-custom-fields/core/api.php on line 338

  • I’m not seeing this error.

    You are calling the_field() somewhere, this is the function that’s failing. You need to figure out which call to the_field() is causing the error and look there. If you post the code where it’s called I’ll look at it.

  • some of posts dont have the field !
    is it possible to error with that post ?
    i dont put if condition for field !

  • Just to be sure, what version of ACF are you using. I’m assuming that it is ACF4 (the free version) because of the path you’ve given for the error. The file you’re referring to does not exist in ACF5.

    The only way that you get an error on line 338 is calling the ACF function the_field(). 338 is the last line of that function where the value is echoed. For some reason when ACF is attempting to get the value of the field it is causing a WP Error. In order to track down what’s causing the error you need to start by looking that the line in your template that’s causing the error.

    Take a look at the page source of a page where the error happens. Look at the HTML that’s being generated before the error. Track down where that code is being generated in your template file. The call to the_field() will be somewhere after that HTML is generated.

  • i use my all code like this :

    <?php if( get_field('episodeupdate') ): ?>
    <?php the_field('episodeupdate'); ?>
    <?php endif; ?>

    and i have plugin named ( IMDBI ) that get some information from external url and put in fields like this :

    <?php imdbi('Poster'); ?>

    is it possible to error from that plugin ?
    because ( Field-Poster ) is picture and plugin get picture and save in media then print URL of that picture !

  • None of this information helps without knowing which specific field is causing the error as well as what type of field it is and why it might be generating the error. It is impossible to debug your error with the information you’re providing. The line of code in ACF is not the cause of the error, something else is. The place to start debugging is the line of code that calls this function and not the line that the error is generated on.

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

The topic ‘advanced-custom-fields/core/api.php on line 338’ is closed to new replies.