Create an article and insert a few images. Now use the media manager and delete on of those images. Clear cache and browser cache. The article will show a question mark where the image was before.
The media manager should do a check, if the image occurs somewhere and give a warning or prevent the image from getting deleted with the media manager.
Image is deleted, the article shows a question mark.
Joomla 3.4.3 and all other versions
I agree. Did take a look into the db, it would indeed be an expensive query. But I would suggest to add a popup to the delete button inside the media manager, to show a warning like: Deleting the file does not delete the link inside Joomla content or other components. Just an idea.
The question came up inside a Joomla forum in case of Virtuemart in the way: why does virtuemart not delete unused product images. I did wrote back that it is barely possible, because you never know where the images are used. If only in Virtuemart, that is no big problem but what if the image is used in Joomla content or somewhere else?
So I would say the issue could be closed.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-08-08 10:35:11 |
Closed_By | ⇒ | brianteeman |
Closed as requested
for history: similar mechanism exist in Drupal, there each image has "count of references" (you cannot delete the image if references > 0
),
but if I right remamber it count references only for images that inside "media field" (or similar), and do not check for images inside editor
It's almost impossible to do such a check since we don't register a used image somewhere. You would have to do a very expensive query where you search for a specific image path in the article text. And then you only took care of com_content. There are many many more extensions which may use those images. So the way Joomla handles media, this is not something that can be achieved.
To my knowledge, even with the proposed new Media Manager, this would still be the same. Maybe @buddhima can confirm?
There is a much simpler alternative, just don't delete images when you're not sure if they are still used somewhere.