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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3210887.patch | 845 bytes | larowlan |
Comments
Comment #2
larowlanAre you able to test this and see if it works for files with usage other than media?
Comment #3
ariacorrente commentedI 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.
Comment #4
larowlanThanks. I'll release this next week
Comment #6
larowlanThis will go out as 1.0.0 in ~5 minutes or so, thanks for your help in testing and opening the issue.