?
avatar franzpeter
franzpeter
8 Aug 2015

Steps to reproduce the issue

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.

Expected result

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.

Actual result

Image is deleted, the article shows a question mark.

System information (as much as possible)

Joomla 3.4.3 and all other versions

Additional comments

avatar franzpeter franzpeter - open - 8 Aug 2015
avatar Bakual
Bakual - comment - 8 Aug 2015

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.

avatar franzpeter
franzpeter - comment - 8 Aug 2015

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.

avatar franzpeter
franzpeter - comment - 8 Aug 2015

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?

avatar franzpeter
franzpeter - comment - 8 Aug 2015

So I would say the issue could be closed.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7656.

avatar brianteeman brianteeman - change - 8 Aug 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-08-08 10:35:11
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 Aug 2015
avatar brianteeman brianteeman - close - 8 Aug 2015
avatar brianteeman
brianteeman - comment - 8 Aug 2015

Closed as requested


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7656.

avatar Buddhima
Buddhima - comment - 8 Aug 2015

@Bakual , yes, it's hard to implement such mechanism.

avatar Fedik
Fedik - comment - 8 Aug 2015

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

Add a Comment

Login with GitHub to post a comment