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

  1. Create a node called Target.
  2. Create a node called Test 1 in English and reference Target in the body field.
  3. Update Test 1 removing the link to Target and creating a new revision.
  4. Create a node called Test 2 in English with an empty body.
  5. Translate Test 2 into French, adding a reference to Target in the body field.
  6. 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

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

AndyF created an issue. See original summary.

andyf’s picture

Assigned: andyf » Unassigned
Status: Active » Needs review

I'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!

andyf’s picture

StatusFileSize
new12.36 KB

Attaching a patch for composer from 8eab48f6e2443ecfd899a61e93f26c700940c2b1, thanks!

marcoscano’s picture

Status: Needs review » Needs work

Thanks 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!

andyf’s picture

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

andyf’s picture

Btw 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 ;)

andyf’s picture

StatusFileSize
new12.23 KB

Attaching a patch for composer from 6bfb4d583fbe3684cd73abb73ea995a414ee1b80, thanks!

alexpott made their first commit to this issue’s fork.

alexpott’s picture

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

alexpott’s picture

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

alexpott’s picture

Status: Needs work » Needs review

Added test coverage

  • marcoscano committed 2de30642 on 8.x-2.x authored by andyf
    Issue #3366527 by andyf, alexpott, marcoscano: Differentiate pending/old...
marcoscano’s picture

Status: Needs review » Fixed

Looks good to me, thanks both for contributing!

marcoscano’s picture

Tagged a new release with this 👍

andyf’s picture

Agree that tests are needed, and I'll get on that over the next few days.

🙄

Thanks @alexpott!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.