WordPress.org

Ready to get started?Download WordPress

Forums

Enable Media Replace
[resolved] I got a bunch of errors (7 posts)

  1. nohler
    Member
    Posted 1 year ago #

    I went to Media > Library
    I selected an image - it opened the 'Edit Media' screen
    I scrolled down to 'Replace media' and click on 'upload new file'
    I chose a replacement jpeg and selected 'just replace file'
    clicked 'upload'

    got these errors:

    Warning: unlink(/home/sidtfocu/public_html/wp-content/uploads/2012/12/newheader-148x19.jpg) [function.unlink]: No such file or directory in /home/sidtfocu/public_html/wp-content/plugins/enable-media-replace/upload.php on line 60

    Warning: unlink(/home/sidtfocu/public_html/wp-content/uploads/2012/12/newheader-148x19.jpg) [function.unlink]: No such file or directory in /home/sidtfocu/public_html/wp-content/plugins/enable-media-replace/upload.php on line 60

    Warning: unlink(/home/sidtfocu/public_html/wp-content/uploads/2012/12/newheader-150x130.jpg) [function.unlink]: No such file or directory in /home/sidtfocu/public_html/wp-content/plugins/enable-media-replace/upload.php on line 60

    Warning: Cannot modify header information - headers already sent by (output started at /home/sidtfocu/public_html/wp-content/plugins/enable-media-replace/upload.php:60) in /home/sidtfocu/public_html/wp-includes/pluggable.php on line 876
    Thank you for creating with WordPress.

    Version 3.5

    http://wordpress.org/extend/plugins/enable-media-replace/

  2. Måns Jonasson
    Member
    Plugin Author

    Posted 1 year ago #

    Hm. I was afraid of this. I'll probably have to supress those errors, since they indicate that you have different sizes of thumbs in your file system than WordPress' database thinks you do.

    This is related to the solution from this thread:
    http://wordpress.org/support/topic/deleting-too-many-images-due-to-dimensions-and-naming?replies=4

  3. dernitoli
    Member
    Posted 1 year ago #

    Hi
    I have the same issue, and in my case it was because the different image sizes are generated on demand, so the files don't exist. I fixed adding a simple file_exists() before the unlink().

  4. Måns Jonasson
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, I will do the same. Hopefully I'll get the chance to update the plugin today.

  5. Strategerizer
    Member
    Posted 1 year ago #

    Mans, did you get a chance to make this change to the plugin?

    I deleted the image files from the server and need to re-upload them. I was hoping to use your plugin so the new files get uploaded in the right date folder and not break existing links...

    Unfortunately I get errors, presumably because the plugin expects to find the file on the server before it take in the new one.

    I am not a PHP coder but maybe you can tell me what/where I need to edit to have the plugin upload the file even if it cannot find the original at the location indicated by the database.

    Thanks!!!

  6. Måns Jonasson
    Member
    Plugin Author

    Posted 1 year ago #

    This will be fixed in 2.9.1 which I'll push shortly.

  7. Strategerizer
    Member
    Posted 1 year ago #

    That's great. For now I had to replace images using FTP in the correct directories but for the future and other people loosing image folders and relying on only the database backup, this could be invaluable.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags