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

  1. Create paragraph types with a media reference, a formatted field, and a link field.
  2. Create a node type with a paragraphs field: field_paragraphs
  3. Reference a media item in each paragraph
  4. Notice the entity_usage table only references the source field field_paragraphs with method entity_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

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

To be determined

API changes

To be determined

Data model changes

To be determined

Command icon 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

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review

The merge request adds the field_name and method to the results, so they can be requested from the entity_reference_revision_field plugin.

anneke_vde’s picture

Status: Needs review » Reviewed & tested by the community

Tested the MR, looks good. After this change, I can see both the method and the field_name.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

@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.