• philonbass

    (@philonbass)


    Hi Roland

    When I upload an image with a file name which already exist in the db, the file gets renamed (usually “_1”). However, these images can only be deleted once from the database entry. When trying again, the image is only deleted in the preview of the data entry, but not in the media library. This only occurs when a filename already exists.

    1. Upload file placeholder1.png -> file is in media library
    2. Upload file placeholder1.png -> file gets renamed placeholder1_1.png
    3. Deleting placeholder1_1.png in database -> file gets deleted in media library
    4. Upload file placeholder1.png -> file gets renamed placeholder1_1.png
    5. Deleting placeholder1_1.png in database -> file gets NOT deleted in media library
    6. 6. and so on

    Can you reconstruct this behaviour?

    Phil

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author xnau webdesign

    (@xnau)

    How are you deleting the image?

    Plugin Author xnau webdesign

    (@xnau)

    Also, check the plugin setting (under the general settings tab) named “Allow File Delete” this must be checked for an uploaded file to delete a previously uploaded file.

    Thread Starter philonbass

    (@philonbass)

    Deleting the image:

    1.

    2.

    3.

    Yes, “Allow File Delete” is checked in plugin settings.

    Plus: Files do get deleted, but only those which have not been renamed after upload. So, in this example, deleting file “placeholder2.jpg” would get deleted in the media library as it has not been renamed when uploading.

    This behaviour occurs only with files uploaded through the add-on plugin which are being renamed due to the filname already existing in the media library.

    Plugin Author xnau webdesign

    (@xnau)

    I see, it appears you’re using the “multi-Upload” field, thanks for clarifying.

    I am testing this with an image that has been renamed by WordPress because an image with the same slug name already exists in the Media Library.

    What I am seeing looks like a display issue: the greyed-out image remains after the image is deleted. The image file is actually deleted, this can be verified by checking the Media Library. When the record is saved, the field correctly shows the remaining images in the field.

    So, it looks like it is working here in my tests, but what you’re seeing is that the image is not deleted from the Media Library.

    If so, we need to look at what might be different about your case. Are you using any other plugins that manage images?

    Thread Starter philonbass

    (@philonbass)

    The image is only not deleted from the media library if it has been renamed in the upload process through the multi-upload field. I disabled “Image Quality Control | Still BE“, but the behaviour is the same.

    Plugin Author xnau webdesign

    (@xnau)

    This is what I have been testing and I’m not seeing the same problem. Maybe I am not doing the same thing you are doing: Using a multi upload field, I upload an image, save the record. The into the same upload field, I upload the same image, the second image has a “_1” added to the name, I save the record. Then, I click the red “X” to delete the second image and save the record. Check the media library, and the copy of the image file with the “_1” is gone.

    Are you doing something different?

    Thread Starter philonbass

    (@philonbass)

    This is exactly what I am doing, and yes, the image gets deleted the first time. However, the second time I upload the same image, which gets renamed “_1” again, this image gets not deleted. It seems not to work all the time. I just realized that I use Lite Speed Cache, maybe it is a cache issue? I will test without the plugin as well.

    Plugin Author xnau webdesign

    (@xnau)

    It is possibly a cache issue, but if the pattern you’re seeing is consistent, that wouldn’t indicate that, since to a cache, there is no real difference between the files that are deleted and those that are not. Caching might make it look like the files were not deleted, however, this would be easy to check by looking in the directory where the files are stored.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Image Expansion Kit: Renamed images not being deleted in media library’ is closed to new replies.