The MU forums have moved to WordPress.org

thumbnails gone after upgrade (25 posts)

  1. kahless
    Member
    Posted 15 years ago #

    Did a search and didn't see this. I just noticed today that the path to the thumbnails for old, i.e, preexisting images seems to be "gone" after I upgraded from a January build to r734. Now I don't think the actual thumbnails are gone and new images uploaded after the upgrade seem to be fine with creating thumbnails. I think the .htaccess changes somehow lost the thumbnail path for those preexisting images. When you try to include one in a new post there is a line through No Thumbnail, but the thumbnail is in the Upload browser. The physical files are still there, so what is up? Anyone else ever see this?

  2. Farms2
    Member
    Posted 15 years ago #

    Have you copied blogs-dir to it's new home?

    Actually the best thing to do is to get the server people to do it for you as it keeps permissions.

    Just copy from wp-inst/wp-content to wp-content and everything should be hunky

  3. pumpkinslayer
    Member
    Posted 15 years ago #

    I can confirm the following behavior myself, these are from post that were made before and now don't work properly.

    • Thumbnails display fine (old links to old thumbnails)
    • Thumbnails linked to an image page are linked fine
    • The image on the image page DOES NOT SHOW, instead there is a text link that will take you to the picture when clicked
    • The images show fine outside of the image page
    • Within the editor, the old thumbnail is seen as missing, but is there (because the original link to it is intact)

    Possible cause: The naming convention for thumbnails changed at some point.

    It used to be: thumb-imagename.ext
    Now its: imagename.thumbnail.ext

    Perhaps the workaround for this was lost in the upgrade. Perhaps renaming all your thumbnails might be a solution.

    Does anyone have any opinions on whether a straight renaming would work?

    I'm using revision 764 from the repository.

  4. Farms2
    Member
    Posted 15 years ago #

    ah... that could also be it :)

  5. kahless
    Member
    Posted 15 years ago #

    I think that they did get renamed to imagename.thumbnail.ext in the upgrade, because using that convention on one of the old thumbnails now shows the thumbnail in the post. However the image upload browser still thinks there are not thumbnails even as it is displaying them???? It has to be a path naming thing in uploads. I haven't actually sshed to the server to see if the thumbnails got renamed in the upgrade but my little test of changing the filename makes me thin they did. I'm just glad I'm not the only one and am surprised no one noticed it before now. I'd hate to have to search through the entire blogs.dir structure and rename all the thumbnails. Is there some handy UNIX command to do this?

  6. kahless
    Member
    Posted 15 years ago #

    I'm going to enter a ticket for this one.

  7. pumpkinslayer
    Member
    Posted 15 years ago #

    After some more testing...

    The thumbnails are only available directly, the image in the image uploader is the full-sized image squashed smaller, not the thumbnail.

    So there is no reference to the thumbnails at all.

    I tried to rename the same files to the current thumbnails convention of filename.thumbnail.ext but that didn't help at all and still nothing displayed.

  8. kahless
    Member
    Posted 15 years ago #

    donncha closed the ticket saying it would be up to one of us to write a script to correct this. See http://trac.mu.wordpress.org/ticket/169

  9. kahless
    Member
    Posted 15 years ago #

    Would some kind soul have the time to write such a script? I don't at the moment.

  10. theworkisdone
    Member
    Posted 15 years ago #

    R777 was not a lucky number for /wp-content/blogs.php ;-) I reverted to the older blogs.php from r766 an Uploads/displaying uploaded images works again.

  11. donncha
    Key Master
    Posted 15 years ago #

    theworkisdone - fixed that, blogs.php should work again!

  12. theworkisdone
    Member
    Posted 15 years ago #

    Thanks, donncha.

  13. andrea_r
    Moderator
    Posted 15 years ago #

    looks like I'm having the same thumbnail issue.

  14. pumpkinslayer
    Member
    Posted 15 years ago #

    Donncha's reply at trac:

    "Sorry, but this won't be fixed unless someone else wants to do it. It shouldn't be too hard. A script needs to find thumbnails with old filenames, then rename them and search each blog's postmeta table for the attachment record and rename it there too."

    Two updates are required then...

    • Update postmeta table
    • Rename thumbnails

    I'll look into this, but I am still trying to get a script to automatically rename all those thumbnails. (I'm no expert at complicated command line stuff). Thanks Donncha for giving direction on an update.

  15. pumpkinslayer
    Member
    Posted 15 years ago #

    Argh...

    Old references with the wp-inst directory still exist

    1. In wp_?_postmeta changed _wp_attached_file and _wp_attachment_metadata values to reflect this.
    2. Renamed the files

    Still nothing...

    Image loader shows the full-sized image but no thumbnail. All newly added images are fine.

    Another strange thing is that each time I edit the old post with the old image I get an additional entry in the wp_postmeta table, so it keeps adding another _wp_attachment_metadata value each time, and the newer one has no value, or at least pretty empty.

    Another stange thing maybe related is that in the terminal (ssh) program, the old image files appear in a green color and with a strange symbol at the end of the filename

    ??????

  16. kahless
    Member
    Posted 15 years ago #

    Hmm, here is a partial listing of my folder in blogs.dir

    2005
    2006
    CaminoScreenSnapz004.png
    CaminoScreenSnapz004.thumbnail.png
    IMG_0300.jpg
    IMG_0300.thumbnail.jpg
    Water lilies.jpg
    Water lilies.thumbnail.jpg
    bad-hair-day.jpg
    bad-hair-day.thumbnail.jpg
    sojourn.jpg
    sojourn.thumbnail.jpg

    So they have the correct naming format but they aren't being put in the year/month/day folder structure?? I'm not exactly sure when the year/month/day started. What would cause this? I'm at a complete loss now.

  17. donncha
    Key Master
    Posted 15 years ago #

    When were those files created?

  18. kahless
    Member
    Posted 15 years ago #

    June 7, 2006
    January 23, 2006
    January 22, 2006 post about images http://jbreitenbuch.blogs.wooster.edu/2006/01/22/43/
    November 14, 2005 this one actually is in the 2005 folder structure and there is a post about images with it as well http://jbreitenbuch.blogs.wooster.edu/2005/11/14/images/

    These are the only dates I uploaded images. I have uploaded files but at other times and they also do not go in the year/month/day structure.

    All of this is pre change from wp-inst. I did not manually change the thumbnail naming or edit any files connected with uploads.

  19. pumpkinslayer
    Member
    Posted 15 years ago #

    As I reported before, I changed all the stuff in the tables and renamed the files, but the problem still persists. The only difference between the old files and the new files now is that the user and group are not set the same.

    The older files are set to my username and the same name for the group, but the new files are set to "nobody" as the user and group. This is apparently an apache thing or something like that, cause when a script runs it runs on the server, not your account only, so a higher user is needed.

    I'll get my admin to change the user settings and see what happens. Then report back...

    Oh, there are only 3 parts in the inline-uploading.php that add meta to the postmeta table. On lines 71, 88 and 196. Only line 196 has to do with viewing files. I'll look into that too.

  20. pumpkinslayer
    Member
    Posted 15 years ago #

    I feel a little like I'm talking to myself here, but here goes.

    The info in wp_?_postmeta with _wp_attachment_metadata is a php array stored in the database, I was confused what the complicated stuff in that field was, but it was an array, so if you pull out the data through php, alter the entries to take away the wp-inst/ from there and then reinsert it. also adjust _wp_attached_file info to take away wp-inst.

    I will go about writing two scripts, one to correct all references to the wp-inst/ directory and point them to the right place. I have found that reanaming the thumbnails will not be necessary, but I like things regular and will probably (maybe) make a script to alter all the thumbnails to filename.thumbnail.ext from thumb-filename.ext

    I'll post back here when that's done.

    BTW By altering the info by hand I made the thumbnails reappear, it was all about the wp-inst/ still in there. And nothing to do with the change in the thumbnail naming.

  21. andrea_r
    Moderator
    Posted 15 years ago #

    Sorry, haven't had time to dig into my own. :) But I am reading along (I read fast.)

  22. kahless
    Member
    Posted 15 years ago #

    Well, I'm not much good for coding things up but I seem to have a knack for finding little issues like this. I just can't believe it wasn't noticed sooner. Maybe there aren't many of us that actually did an upgrade from pre rc versions. Thanks for putting in the time to track down the issue and for writing a script.

  23. pumpkinslayer
    Member
    Posted 15 years ago #

    Basically done with the script and I have updated my own site using it. It just strips out the "wp-inst/" from the hardcoded directory names.

    I'll post it here soon.

  24. pumpkinslayer
    Member
    Posted 15 years ago #

    Script completed

    wpmu-update-attachment-metadata.txt

    Notes:

    • Rename the file to .php
    • Verbose output. To visually make sure that the checks were correct all the original and replacement values are shown on screen.
    • My site is small, if your site is very big I'm not sure how it will handle (all blogs are processed on 1 page)

    Otherwise it works just fine. All your thumbnails will be accessible again.

  25. pixline
    Member
    Posted 14 years ago #

    Just to let you know, his solved also my upgrade from 1.1.1 to 1.2.3 (I forgot some upgrades, and it messed up not-so-less things :-)

About this Topic