WordPress.org

Ready to get started?Download WordPress

Forums

How to updat the thumbnail name is the postmetadata table (10 posts)

  1. henri
    Member
    Posted 5 years ago #

    Hi all,

    I run 2.5.1 on my blog and previously I use thumbnail named as myimage.thumbnail.jpg, since I upgrade to 2.5 I use myimage-125x125.jpg. I order to use the right thumb I upload to my upload folder new thumbs with the new name structure.

    I change also data in the wp-postmetadata table with this sql command :

    UPDATE wp_blog4autopostmeta SET meta_value = replace(meta_value, '.thumbnail','-125x125')

    But when I do that I have a error on the media library :
    Warning: Invalid argument supplied for foreach() in /home/www/myfolder/wp-includes/media.php on line 264

    Any idea?

    Thanks for your help

    Henri

  2. henri
    Member
    Posted 5 years ago #

    Sorry for the title, you need to read :
    How to update the thumbnail name in the postmetadata table?

  3. henri
    Member
    Posted 5 years ago #

    any news? thanks

  4. nedsferatu
    Member
    Posted 5 years ago #

    i'm having this same error. what i did to generate this error was to move the blog to a new domain. in doing so i backed up the database and did a find and replace changing all instances of the old domain with the new one. most of those were pictures. everything else about the move went fine except for this error.

    riri, have you had any luck?

  5. lxne
    Member
    Posted 5 years ago #

    Hi nedsferatu,
    I moved my blog too and got the same problems. It only occurs with pictures.
    The two oldest of mine are fine (I think they are of wp 2.3 times) the others all show the error-message. Newly uploaded ones are fine either.

    Hints would be appreciated.

  6. asv2001
    Member
    Posted 5 years ago #

    Same problems. I have made a quick fix. May be this can be useful:
    1. Open file wp-includes/media.php
    2. Find go to line 264:
    // get the best one for a specified set of dimensions
    $imagedata = @unserialize($imagedata); //this is a quick fix

  7. nedsferatu
    Member
    Posted 5 years ago #

    asv2001, thanks! adding that line after the given comment got rid of the error in Manage >> Media Library. Can you give a quick comment on how/why it works? I'm always looking to learn something new about wordpress.

  8. henri
    Member
    Posted 5 years ago #

    great news! I will try this hack this night, thanks for the tips

  9. wewa
    Member
    Posted 5 years ago #

    Thanks for this hint!

    @nedsferatu:
    WP converts arrays to strings (maybe with "serialize") to save them in databases. And to get an array back out of these strings you can use "unserialize". But I don't know exactly why this fixes our problem.

  10. hemzz
    Member
    Posted 5 years ago #

    Hi can anyone help me upload pictures on my blog??i dont know how to do it can any one mail me the steps to do it my email address is srinivasa.hema@gmail.com

Topic Closed

This topic has been closed to new replies.

About this Topic