• Resolved Sandra Romano

    (@sandraromano)


    Hi there!

    I am able to save all retrieved data in the AF form to ACF custom fields, but after submitting the form, I get these error messages:

    ***
    Warning: Illegal string offset ‘url’ in /homepages/41/d544242651/htdocs/wp-content/plugins/advanced-forms/api/api-helpers.php on line 103

    Warning: Illegal string offset ‘title’ in /homepages/41/d544242651/htdocs/wp-content/plugins/advanced-forms/api/api-helpers.php on line 103

    Warning: Cannot modify header information – headers already sent by (output started at /homepages/41/d544242651/htdocs/wp-content/plugins/advanced-forms/api/api-helpers.php:103) in /homepages/41/d544242651/htdocs/wp-includes/pluggable.php on line 1251

    Warning: Cannot modify header information – headers already sent by (output started at /homepages/41/d544242651/htdocs/wp-content/plugins/advanced-forms/api/api-helpers.php:103) in /homepages/41/d544242651/htdocs/wp-includes/pluggable.php on line 1254
    ***

    One of the fields is “file” type, and I save it with “af_save_field( ‘texto_original’, $post_id );”. The first two errors refer to the “title” and the “url” of the file uploaded.

    I cannot understand what is happening or what I am doing wrong. The post is correctly created in the back-end, thoug.

    Any help would be much appreciated.

    Greetings.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author fabianlindfors

    (@fabianlindfors)

    Hi, Sandra!

    I think you code is totally fine and the warnings stem from a different issue. These warnings occur because you’re using the file field in either the success message or an email notification. If you want to include the field you need to set “Return value” to “File array” in the ACF field settings.

    I’m sorry that this isn’t documented better!

    Thread Starter Sandra Romano

    (@sandraromano)

    Many thanks, Fabian! Everything is ok by now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error when saving form to ACF fields’ is closed to new replies.