Problem/Motivation

Currently the link to create the media is visible only when the "Used in" counter is zero. If the file is used in any field or inside a CKEditor the link is not visible. It will be useful to hide the field only if the file is already used in a media element.

My use case for this module is to replace some file elements with the new media elements without requiring a full migration of all the images of the website. With the current version my procedure should be:

1. remove all references to the image on all revisions and take note about it
2. create a new media with this module
3. add the new media where the images have been removed in point 1

If it where possible to create the media entity before removing all the references the procedure could be:

1. create a new media with this module
2. replace all the references of the file with the new media
This cuts almost to half the time required to scan all the content referencing the image.

The user may even want to replace only some references and allow the coexistence of an image as file and as media. I do not know if this could have some negative effect.

Thank you.

CommentFileSizeAuthor
#2 3210887.patch845 byteslarowlan

Comments

ariacorrente created an issue. See original summary.

larowlan’s picture

Status: Active » Needs review
StatusFileSize
new845 bytes

Are you able to test this and see if it works for files with usage other than media?

ariacorrente’s picture

I tested the patch on a local copy of the website I maintain and it worked fine.
The link was visible when the file was in use in a content type and was not visible when the file was used in a media. It worked with images and documents, with media manually created and media migrated.

In the following days I hope to have time to work on the migration on the site and test more the patch. Let me know if you need me to test something specific.

larowlan’s picture

Thanks. I'll release this next week

  • larowlan committed 122ca18 on 1.x
    Issue #3210887 by larowlan: Filter "Used in" limit to media only fields
    
larowlan’s picture

Status: Needs review » Fixed

This will go out as 1.0.0 in ~5 minutes or so, thanks for your help in testing and opening the issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.