Support

Account

Home Forums Add-ons Gallery Field Code error on line 335

Helping

Code error on line 335

  • I have several custom post types where I’m using the gallery plugin to manage images that I’m wiring up to display as a header gallery in the page layout. My code iterates through the items in the gallery, if there are any, and then fires the javascript to start the display of the gallery.

    There are no issues on the front end display or backend management, except when there are no images in the gallery. When there are no images, I get the following error message:

    Warning: array_map(): Argument #2 should be an array in /var/www/public_html/wp-includes/query.php on line 2164 Warning: implode(): Invalid arguments passed in /var/www/public_html/wp-includes/query.php on line 2164 Warning: Invalid argument supplied for foreach() in /var/www/public_html/wp-content/plugins/acf-gallery/gallery.php on line 335

    I can see the code expects something to parse in an array, but there is nothing to go through when the array is empty.

    Nothing breaks, but I can imagine this will bother the client. I’d love to know how to get this error out of the post edit screen.

    WordPress: 3.6.1
    ACF: 4.3.1
    ACF Gallery: 1.1.0

    • Elliot

    • November 26, 2013 at 11:04 am

    Hi @alexbarber

    Thanks for the bug report. I’ll take a look for any array_map calls in the glalery field.

    Thanks
    E

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