Support

Account

Home Forums Bug Reports Undefinded index errors in text.php after importing content

Solved

Undefinded index errors in text.php after importing content

  • I’ve been using ACF as fields on a custom post type with great success and am very pleased with it. However I’m currently trying to see if I can bulk import content from a CSV file to save a lot of time which is causing an undefined index error in the ACF code.

    I’ve found plugins that acknowledge the custom post type and let me save data to the custom fields, everything seems to import fine – however where get_field() or the_field() is called I get the following two errors:`Notice: Undefined index: formatting in […]/core/fields/text.php on line 156

    Notice: Undefined index: formatting in […]/core/fields/text.php on line 160`

    Which refers to the following from text.php:

    if( $field['formatting'] == 'none'
    elseif( $field['formatting'] == 'html'

    The field content is still passed to the variables and displays fine, but the errors show up where it is called (I have debug on).

    I appreciate this could well be caused by issues with the content I’m importing or the plugin I’m using – but the content displays as expected and I can ‘update’ the post without changing anything and all the errors all disappear so I assume field[formatting] or something is not being set or run when imported as opposed to an update.

    It’s not a major problem, but it is causing loads of notices everywhere which are getting in the way! (Any workaround suggestions will be gratefully accepted!)

  • @hennell,

    What plugin(s) did you use to import the CSV data?

    Also, what do you see when you var_dump() the field object?

    • Elliot

    • July 6, 2013 at 11:08 am

    Hi @hennell

    May I ask which version of ACF are you using?

    This error has been fixed in the latest few updates

  • @elliot I was on 4.1.5 – For some reason wordpress wasn’t announcing the update on the plugin page – but I’ve manually updated and errors are now gone – thanks!

Viewing 4 posts - 1 through 4 (of 4 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.