Problem/Motivation
Thanks for a fantastically useful module! It's being used on a multi-lingual site where people can't tell the difference between a reference in an old revision from one within a default translated revision. From their point of view it's critical to know if something's referenced in a default revision whatever the language.
Steps to reproduce
- Create a node called Target.
- Create a node called Test 1 in English and reference Target in the body field.
- Update Test 1 removing the link to Target and creating a new revision.
- Create a node called Test 2 in English with an empty body.
- Translate Test 2 into French, adding a reference to Target in the body field.
- Look at the entity usage for Target
The entity usage page doesn't let you differentiate between the usage in the default French revision vs the old English revision: it just says Translations or previous revisions.
Proposed resolution
I can see a number of ways of displaying the information. I was thinking we could separate out default, pending and old revisions into separate lines in the same table cell. If more than one language is involved, the languages can be listed, but if not try to leave the wording the same.

Remaining tasks
User interface changes
See the description and image above, this is purely a UI change to the listing page.
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork entity_usage-3366527
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
andyf commentedI've made a first attempt at that. It could be cleaned up a little and the testing increased, but I was hoping to get some initial feedback on the overall approach before going further with the polish...?
Thanks!
Comment #4
andyf commentedAttaching a patch for composer from
8eab48f6e2443ecfd899a61e93f26c700940c2b1, thanks!Comment #5
marcoscanoThanks for contributing!
I agree this would be a nice addition to the usage page, and I'm onboard with adding this to the module. I left a comment on the code about improving wording on the UI text, but apart from that I don't see big red flags.
It would be important to add test coverage to all new scenarios we are adding, combinations of languages, pending/past revisions, etc.
Thanks!
Comment #6
andyf commentedThanks so much, glad to hear this could make its way into the module! Agree that tests are needed, and I'll get on that over the next few days.
Comment #7
andyf commentedBtw just in case you hadn't seen, but there seems to be a layout-builder related failure with D10.1 which I think is entirely unrelated to this MR, see eg https://www.drupal.org/pift-ci-job/2692049... had me well confused yesterday wondering what I'd broken ;)
Comment #8
andyf commentedAttaching a patch for composer from 6bfb4d583fbe3684cd73abb73ea995a414ee1b80, thanks!
Comment #10
alexpottWe will need to add a test for and fix #3408306: Usages that have no revisions show up as "Translations or Previous Revisions" as that one went in without a test and caused a conflict when I rebased the MR.
Comment #11
alexpottGood news is the manual testing shows that this issue was a fix for #3408306: Usages that have no revisions show up as "Translations or Previous Revisions" too! Now to add some automated test coverage.
Comment #12
alexpottAdded test coverage
Comment #14
marcoscanoLooks good to me, thanks both for contributing!
Comment #15
marcoscanoTagged a new release with this 👍
Comment #16
andyf commented🙄
Thanks @alexpott!