WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2.7 Upload New Media - Warning: array_key_exists() (12 posts)

  1. emilb
    Member
    Posted 5 years ago #

    I get thist warning after upgraded to 2.7. Problem occurs whenever I try uploading pictures, and when I access the Media Library.

    Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in /nfs/c03/h02/mnt/50559/domains/psforum.no/html/wp-admin/includes/media.php on line 736

  2. emilb
    Member
    Posted 5 years ago #

    Tried uploading all the files again, but it didn't work.

  3. infected
    Member
    Posted 5 years ago #

    using akismet? deactivate it and try again. maybe it helps...

  4. emilb
    Member
    Posted 5 years ago #

    I do not use Akismet.

  5. emilb
    Member
    Posted 5 years ago #

    FIXED IT!
    Here is a screenshot of the problem:
    http://lastopp.no/filer/fbc567d1169154d5b4e7e4f7429cfb6e.png

    Solution:

    Go to your /wp-admin/media.php. Scroll down to line 736 then change
    if ( !array_key_exists($checked, $alignments) )
    to
    if ( !array_key_exists('$checked', $alignments) )

    Finally :)

  6. coffeeaddict007
    Member
    Posted 5 years ago #

    This helped fix my problem with Media related pages!
    It should go into the next update!
    Thank you emilb!

  7. Adam Robertson
    Member
    Posted 5 years ago #

    This also fixed the same problem using WordPress mu 2.7 beta. Thanks

  8. jonahcoyote
    Member
    Posted 5 years ago #

    Hmmm, I'm having this same issue and I only have 121 lines in my /wp-admin/media.php file. Is this the correct file?

    Anybody else have any other ideas for this?

    Thanks,
    Jonah

  9. mzuvella
    Member
    Posted 5 years ago #

    Jonah,

    File is /wp-admin/includes/media.php

    /includes is what you're missing

    --Matt

  10. oldford
    Member
    Posted 5 years ago #

    Thanks! Just fixed this problem on my newest install.

  11. jeniadventure
    Member
    Posted 5 years ago #

    I made the php change but I still get an error message saying:
    The uploaded file could not be moved to /nfs/www/WWW_pages/lsraa/wp-content/uploads. when I use the Flash uploader and the browser uploader.

    I used ftp to manually put the images into the .wp-content/uploads dir and they do not show up in the media library.
    Any other ideas?
    thanks
    Jeni

  12. akcakaya
    Member
    Posted 5 years ago #

    Hi,
    if you dont set your media size from Settings->Media menu you can see this error. Certain solution is to set Thumbnail size, Medium size and Large size from Settings->Media menu.

    Have a nice day.

Topic Closed

This topic has been closed to new replies.

About this Topic