Problem/Motivation
Provide support for Media with contextual modifications fields from the Media Library Media Modify module.
The machine name of the field provided by the module is entity_reference_entity_modify
See the field plugin in the source code of the module.
Since EntityReferenceEntityModifyItem extends EntityReferenceItem we only need to add the entity_reference_entity_modify field to the list of field types in docroot/modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/EntityReference.php
Attached is a patch to add support for this field type.
Steps to reproduce
Install entity usage
Install the Media Library Media Modify
Install media
Setup a content type with a field of type Media with contextual modifications to reference media
Setup entity usage, at a minimum, to track media as a target and nodes as a source
Add a new piece of media content
add a new piece of the content type you created above and reference a piece of media
Go back to your media, look at the usage and confirm it is not tracking the media from the newly created piece of content.
Proposed resolution
Apply the supplied patch.
Remaining tasks
Add test coverage for this new field type?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3432234-media-library-media-modify-support.patch | 499 bytes | devanbicher |
Comments
Comment #2
devanbicher commentedThe attached patch provides support for the field described.
Comment #3
kushbhatt commentedI tested patch #2 and worked well on Media Library management.
Comment #4
silvi.addweb commentedComment #6
marcoscano