Problem/Motivation
In 8.x-2.x entity_usage info included specific data for Paragraphs. However, in 5.x all usage from paragraphs is reduced to a single entry with the entity_reference_revision_field method.
As a result, the entity usage info is no longer usable to replace references in paragraphs entities, since the source field name and method are no longer available. We used this information to merge media item references when editors uploaded the same image multiple times, but it also can be used for more precise usage information on the ListUsageController
Steps to reproduce
- Create paragraph types with a media reference, a formatted field, and a link field.
- Create a node type with a paragraphs field:
field_paragraphs - Reference a media item in each paragraph
- Notice the entity_usage table only references the source field
field_paragraphswith methodentity_reference_revision_field, but no data on the plugin or field that contains the reference
Proposed resolution
Reintroduce a method to determine usage info for paragraphs
Remaining tasks
- Write a merge request
- Review
- Commit
User interface changes
To be determined
API changes
To be determined
Data model changes
To be determined
Issue fork entity_usage-3628574
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
idebr commentedThe merge request adds the field_name and method to the results, so they can be requested from the
entity_reference_revision_fieldplugin.Comment #4
anneke_vde commentedTested the MR, looks good. After this change, I can see both the method and the field_name.
Comment #5
alexpott@idebr how does making this method public help you? Fundamentally the data is recorded in a different way.
I'm not saying no this MR - just trying to get the use-case and see if there's a better way than making a random method on plugin public.