• Since the update on my local host I recieved the following errors:
    Warning: explode() expects parameter 2 to be string, array given in C:\wamp\www\wp theme\wp-includes\query.php on line 2390
    and
    Warning: in_array() expects parameter 2 to be array, null given in C:\wamp\www\wp theme\wp-includes\query.php on line 2399

    Now, I don’t know if it actually fixed anything but I edited the file to force an array and it seemed to remove the errors well enough. I don’t know of any adverse affects to doing this yet.

    var_dump($q['post_status']);
    			$statuswheres = array();
    			$q_status = $q['post_status'];//explode(',', $q['post_status']);
    			$r_status = array();
    			$p_status = array();
    			$e_status = array();
    			if ( $q['post_status'] == 'any' ) {
    				foreach ( get_post_stati( array('exclude_from_search' => true) ) as $status )
    					$e_status[] = "$wpdb->posts.post_status <> '$status'";
    			} else {
    				foreach ( get_post_stati() as $status ) {
    					if ( in_array( $status, array($q_status) ) ) {//previously ## if ( in_array( $status, $q_status ) ) {

    I added the dump as a check to see just what is being retrieved. For some reason the original update file recieved the post variable as an array, not a string to use explode() on. This forced the initial $q_status to recieve an error when attempting to build an array using the explode() because explode() expects a string to break apart, not an array…which is what it was recieving.

    As such, the $q_status array wasn’t being set. To further the oddity, the in_array() on line 2399 was being fed $q_status which was a string, not an the expected array.

    Can someone tell me if my temporary solution is, in fact, a solution or if I should expect it to cause errors down the road?

Viewing 13 replies - 16 through 28 (of 28 total)
  • I had the same problem too while trying to add new media. Hot fix fixed it. awesome!

    HotFix worked for me also. Thanks so much.

    I’ve had Hotfix installed on three of my sites since it was version 0.1 (now 0.5) and I have never had a chance to test it. Within 2 minutes of the above issue being brought to my attention, I had found this thread and wondered why Hotfix had not worked for me.

    …then I checked and realized it was installed but not activated. Now everything is as it should be.

    Hotfix is the number one recommendation anytime someone asks what plugins I use. No site should run without it.

    The Hotfix worked for me as well.

    Hotfix didn’t work for me, but Daya’s code did. Thank you Daya!

    Strange.

    I’ve update my live site to version 3.1.3. It has no problems in Media Library. But when I used this 3.1.3 in development stage as new installation, it does show the errors.

    Daya’s solutions works for me. Thanks Daya!

    Sunnre:

    Could there potentionally be a problem with using Daya’s solution?

    I shouldn’t think so but if you’re worried, back up the original query.php file just in case.

    Thanks Daya! This worked for me too.

    Thank you Daya! Your solution was perfect for me!

    Thread Starter unrelatedmedia

    (@unrelatedmedia)

    currently running Hotfix on some live sites without issue. I will leave this issue open for now, as there appears to be a need. It may also prove useful should anyone encounter any issues with any of the fixes listed.

    If anyone is keeping an eye on the WordPress trunk and sees this fixed for the next update please post here to let the community know!

    Daya! Thanks a lot!!
    *hugs* really need this ^^

    Daya!
    xcellent post, worked like a charm ??

    I’m going to close this thread.

    The Hotfix plugin should solve all issues: https://www.ads-software.com/extend/plugins/hotfix/

    If it doesn’t, then I wouldn’t be surprised if you have something else going on and you should open a new thread.

    Cheers.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘[UPDATE Error]wp-includes/query.php array line 2390’ is closed to new replies.