WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Error message when i click on media in admin (32 posts)

  1. gavpedz
    Member
    Posted 3 years ago #

    i get this error in the header when clicking on media in admin only seems to happen in media

    Warning: explode() expects parameter 2 to be string, array given in /mypath/public_html/wp-includes/query.php on line 2390

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

    Warning: in_array() expects parameter 2 to be array, null given in /mypath/public_html/wp-includes/query.php on line 2399

  2. pacergh
    Member
    Posted 3 years ago #

    I just began getting this error too. Doesn't seem to be anywhere else. Also, I installed an update last night. I'm wondering if something in the update is causing this. I believe it was 3.1.3.

    Tried to reinstall just to see if that fixed it, no dice.

    The line numbers in question reference an IF statement in query.php regarding post_status

    if ( isset($q['post_status']) && '' != $q['post_status'] ) {
    			$statuswheres = array();
    			$q_status = explode(',', $q['post_status']);

    A real ugly nuisance, but nothing seems to be effected other than my media pages. And those still allow me to upload new media just fine, add media to posts, etc.

    Odd. Too early to diagnose more. Need coffee.

  3. pacergh
    Member
    Posted 3 years ago #

    Okay, I lied -- coffee is waiting a bit more.

    The following is a portion from the 3.1.3 release notes:

    Media security fixes by Richard Lundeen of Microsoft, Jesse Ou of Microsoft, and Microsoft Vulnerability Research.
    Improves file upload security on hosts with dangerous security settings.

    Amusing comments about Microsoft possibly breaking (or just making ugly) my WordPress install (I kid! Good contributors!), it looks like the media security fixes did something odd. Either that or my file upload security is throwing up some errors! Do I need to harden, or was there an error in the Media security fix?

  4. gavpedz
    Member
    Posted 3 years ago #

    I updated to 3.1.3 also seems like it might be something to do with this hope there is a fix soon.

  5. pacergh
    Member
    Posted 3 years ago #

    I'm confident there will be something. After all, a lot of poor schmucks like use who update to 3.1.3 should soon start getting the same error and come here to find out what's going on.

  6. abeltman
    Member
    Posted 3 years ago #

    Same problem here. Hopefully a fix will come soon as I'm currently unable to access the Media section.

  7. 2twins
    Member
    Posted 3 years ago #

    same error- i just updated! it is in the media section. hopefully the fix will be revealed in this thread when it happens??

  8. Seth Alling
    Member
    Posted 3 years ago #

    Here's the change from WordPress trac that fixes it.

    http://core.trac.wordpress.org/changeset/18047

    It looks like we'll have to wait till 3.1.4 for it to be an official fix, but, if you want to fix it now, you can just make the changes yourself to the file and everything should be working. It worked for me.

  9. Alternately, install http://wordpress.org/extend/plugins/hotfix/ and it'll fix it.

    This is a weird bug that hit a VERY small group of people, and the devs know. The mods are reporting it up the chain ;)

  10. I believe this glitch can also be fixed by applying the Hotfix plug-in:

    http://wordpress.org/extend/plugins/hotfix/

    Let me know if it works.

  11. Whoops - Ipstenu beat me to it. ;-)

  12. abeltman
    Member
    Posted 3 years ago #

    Yep... I can confirm that applying the "hotfix" Plug-in solves the problem. Media Library is working again.

    Thanks all!

  13. techcorp
    Member
    Posted 3 years ago #

    Thanks Ipstenu and zooni for the hotfix worked for me as well, at first I thought it was a corrupt database.

  14. Aphrodite
    Member
    Posted 3 years ago #

    yep same here. The modified query.php file works fine.

    Thanks to Big Brother ^^

  15. Daya
    Member
    Posted 3 years ago #

    In English :
    You can correct this error ;) Edit the file query.php on directory wp-includes of WordPress :
    replace :

    if ( isset($q['post_status']) && $q['post_status'] != '' ) {
    			$statuswheres = array();
    			$q_status = explode(',', $q['post_status']);

    by it :

    if ( ! empty( $q['post_status'] ) ) {
    			$statuswheres = array();
    			$q_status = $q['post_status'];
    			if ( ! is_array( $q_status ) )
    				$q_status = explode(',', $q_status);

    In French / en Français :
    Vous pouvez corriger cette erreur ;) Editez le fichier query.php dans le dossier wp-includes de WordPress :
    remplacez :

    if ( isset($q['post_status']) && $q['post_status'] != '' ) {
    			$statuswheres = array();
    			$q_status = explode(',', $q['post_status']);

    par ça :

    if ( ! empty( $q['post_status'] ) ) {
    			$statuswheres = array();
    			$q_status = $q['post_status'];
    			if ( ! is_array( $q_status ) )
    				$q_status = explode(',', $q_status);

    Enjoy xD

  16. cziko
    Member
    Posted 3 years ago #

    So good to have you guys! I modified query.php file, works perfect. But before that I made loud "WTF".

  17. esmi
    Forum Moderator
    Posted 3 years ago #

    Admittedly it's a (minor) "Oops" but equally importantly why are you running live sites with display_errors on? That's hardly secure, guys.

    In the meantime just use the Hotfix plugin: http://wordpress.org/extend/plugins/hotfix/

  18. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    Do not hack core. Please just install the Hotfix plugin.

    http://wordpress.org/extend/plugins/hotfix/

    Thanks and sorry for the inconvenience.

  19. equally importantly why are you running live sites with display_errors on

    It defaulted to on in my case and I'd never noticed until now. *ahem* Turned off.

  20. mcdonna
    Member
    Posted 3 years ago #

    @esmi, this isn't a live site; I'm developing off-line so I want errors on. Would just hope to see only my own errors. :)

  21. esmi
    Forum Moderator
    Posted 3 years ago #

    Install the Hotfix plugin. Or wait until the issue is resolved in WP 3.1.4.

  22. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    Or wait until the issue is resolved in WP 3.1.4.

    We haven't decided on 3.1.4 yet. Install Hotfix for dev sites and display_errors off for production sites.

  23. esmi
    Forum Moderator
    Posted 3 years ago #

    Thanks, Nacin. I'll keep that in mind.

  24. Jeremiah
    Member
    Posted 3 years ago #

    Yes, installing the hotfix plugin solved the problem. Thanks!
    I'm running in a production environment, but I'm not sure how to change the 'display_errors' setting? Can someone explain how to disable this setting. I have never changed it as far as I know so I suppose it must be a default setting that it is on?

  25. gailstorm
    Member
    Posted 3 years ago #

    Hi everyone - same problem for me too so will apply hotfix. As for 'display_errors' - never heard of it so no idea where to change it or how to check current status. Can someeone please tell me where to look for this to change it please? thanks in advance...

  26. If your server is running PHP as an Apache module, and allows PHP overrides, you can add this line to your site's .htaccess file to turn error display off:

    php_flag display_errors off

    Or, in your server or site's php.ini file, change display_errors value to Off instead of On:

    display_errors = Off

  27. toyNN
    Member
    Posted 3 years ago #

    I was having this issue also, glad I found this thread. Applied the Hotfix plugin - error is gone. Thanks.

  28. gaspas
    Member
    Posted 3 years ago #

    I have the some problem.

    And just happen after i made a deploy from one server to another server.

    And i fixed it with the plugin. If it help i could try to get both php parameters

  29. markellison
    Member
    Posted 3 years ago #

    I had this problem too, installed Hotfix, worked like a charm!

  30. petergriffyn
    Member
    Posted 3 years ago #

    This may or may not be related, but I installed W3 Total Cache which required permissions changes (755 to 777) on wp-content and wp-content/.htaccess. and then back again.

    I began receiving the errors shortly after that.

    You know what I love about WP? Every time I have a WP problem, I find a WP answer.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.