• cmehrabian

    (@cmehrabian)


    On successful searches, WordPress throws error “Warning: Invalid argument supplied for foreach() in /home/indiee5/public_html/socionext/wp-includes/query.php on line 4890”

    Search is still working correctly, and when I disabled the plugin or comment out the forEach in query.php the warning disappears.

    Any body have any experience with this warning error?

Viewing 4 replies - 1 through 4 (of 4 total)
  • JiveDig

    (@jivedig)

    Same issue here.

    Query monitor says it’s coming from “Plugin: searchwp”

    Thread Starter cmehrabian

    (@cmehrabian)

    Hey @jivedig,

    I contacted support about this, and searchWP wasn’t able to figure out the exact issue.
    They did include this filter that got rid of the warning,

    add_action( 'pre_get_posts', function( $wp_query ){
    	if ( is_search() ) {
    		set_query_var( 'update_post_term_cache', false );
    	}
    } );

    but also stated that there might be something unique to my dev environment which is triggering the issue. I suggest you contact support and see if they can give your site a proper diagnosis.

    JiveDig

    (@jivedig)

    I got a reply on twitter with that same code. Works until they come up with a fix in core. Thanks!

    Just wanted to post that this issue has been resolved in SearchWP 2.7.2 — once you’ve updated you can remove the action referenced above and you should be good to go!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress throwing warning error on successful SearchWP searchs’ is closed to new replies.