Problem/Motivation
ListUsageController::buildRows() classifies a usage record as current or old by comparing its source_vid to the source entity's default revision ID. It demotes a pending record to old, but only when a newer pending source_vid exists among the target's usage records.
This fails when the target is not referenced in the latest source revision, since no usage record exists at that vid. Example: the published revision (vid 10) has no usage, an old draft (vid 12) has usage, and the latest draft (vid 15) has none. The vid 12 record is shown as a draft instead of old.
Steps to reproduce
- Create a published revision of a node.
- Create a draft with a media usage.
- Create another draft removing the media usage.
This should should as 1 usage in an old revision because the old draft at this point is an old revision but it will show as a draft revision usage. If you go to edit the node you will not see the media.
Proposed resolution
Fix this in a performance and translation aware way.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork entity_usage-3624974
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
alexpottWe've got good test coverage around this and it plays well with the new capability to exclude old revisions so by default you only see usages in published revisions or the latest draft.
Comment #5
alexpott