Hi Ov3rfly,
Thanks for reporting this.
So we’re on the same page, here’s what happens when you change the slide image:
1. The image you want to change to is duplicated on your server. It should* go into the same folder as before, but the filename will have a “1” on the end of it (or whatever the “wp_unique_filename” function decides).
2. The slide db record (nb, a slide is just a media file) is then updated to point to the duplicated file.
The file is duplicated to ensure that 2 media files don’t end up sharing the same physical image (that becomes an issue if one of the media files is deleted).
So the result should be that everything remains the same (metadata etc) apart from the path to the image on the slide.
You’ll see 2 media files that look identical in your Media Library because we’ve copied the image from one media file to another, but the old media file will remain unchanged.
Does that match up with your findings?
*this sounds like a bug, is there anything unique about your installation? Maybe Multi Site or running on Windows?
Regards,
Tom
The main problem (or bug?) was, that the database entry meta _wp_attached_file
of the previous image id was changed to the url of the new image. There should be no reason at all for a write to this entry in your described process.
Both images were uploaded via normal Media Library and later selected from there in the Plugin.
No multisite, no windows.
Hi Ov3rfly,
Apologies for the delay getting back to you. The testcase you’ve provided is how I’d expect it to work (its similar to how it would work if you used the Replace Media plugin directly on a media file), could you explain how you think it should work please? It’s not set in stone so I can always change it if there’s a better way 🙂
Regards,
Tom
I would expect that such a feature would remove one slide from the slideshow and replace it with a new slide (including the new title/alt/etc from the new image). Like you would delete the slide from the slideshow an add a new one.
I would never expect that such a feature would actually overwrite the image-path of an existing media library entry.
Scenario at my customer: Image2 is also used on pages, in articles as inline image and similar. After the testcase these pages and articles show Image41 instead of Image2, but with Image2 caption etc. That’s not good.
A slider plugin should be basically a collection of media library IDs and only override title/alt/etc. of the media library entry if configured within the slider plugin and store such configuration in some slider plugin meta/options. It should never actually write to original medial library entry.
Any news here?
Had to remove the “change image” button at my customer in the meantime to avoid further unwanted changes to media library entries.
Added this CSS to admin area until problem is fixed.
div.metaslider tr.slide a.change-image {
display: none;
}
Hi Ov3rfly,
The functionality has been removed in 3.2.1 until I work something out.
Regards,
Tom