Problem/Motivation
`entity_usage_addons` detailed usage rendering can miss `(previous revision)` labels for paragraph-backed references.
Paragraphs already owns this behavior in `Paragraph::label()`: when a paragraph is only referenced from an older parent revision, the label includes `(previous revision)`.
However, in `entity_usage_addons`, detailed usage currently uses grouped usage data (via `listUsage()`), which is flattened by source entity ID and does not retain full revision context for rendering.
As a result, detailed usage can load the default paragraph revision instead of the relevant older paragraph revision, and the expected `(previous revision)` suffix is not shown consistently.
Related context:
- Paragraphs issue: https://www.drupal.org/project/paragraphs/issues/2954039
- Existing entity_usage_addons detailed usage patch context: https://www.drupal.org/project/entity_usage_addons/issues/3000184
Steps to reproduce
1. Enable `entity_usage`, `entity_usage_addons`, and `paragraphs`.
2. Create two media documents: `Doc A` and `Doc B`.
3. Create content with a paragraphs field that includes a paragraph referencing `Doc A`, then save.
4. Create a new revision of the same content where the same paragraph item now references `Doc B` (so `Doc A` is only used in older revisions).
5. View detailed usage output for `Doc A` using `entity_usage_addons` (for example, via a view/formatter that renders detailed usage entity labels).
6. Observe that the label is not reliably marked as `(previous revision)` even though this is old-revision-only usage.
Proposed resolution
In `entity_usage_addons` detailed usage rendering:
- keep current grouped row behavior, but also read revision-aware usage records (`source_vid`) from `listSources()`,
- for `paragraph` sources, if usage is previous-revision-only, load the paragraph revision indicated by usage records (instead of always loading the default paragraph revision),
- render using that revision so existing `Paragraph::label()` logic can produce `(previous revision)` correctly,
- do not add a second `(previous revision)` suffix implementation in `entity_usage_addons` itself.
This keeps suffix ownership in Paragraphs and fixes revision-context loss in detailed usage rendering.
Remaining tasks
- Implement patch in `entity_usage_addons` service logic for detailed usage rendering.
- Verify no status-column behavior changes (this issue is about entity label rendering in detailed usage).
User interface changes
No new UI elements.
Existing detailed usage entity labels become more accurate: paragraph-backed previous-revision references are consistently shown as `(previous revision)` where applicable.
API changes
None expected.
Data model changes
None expected.
Issue fork entity_usage_addons-3580132
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