Usage list page does not show translations

Created on 17 August 2022, over 2 years ago
Updated 19 April 2024, 12 months ago

Problem/Motivation

Translations share the same source ID as the default language entity. However, the usage list building code does not account for translations properly.
The code in EntityUsage::listSources() groups the records by source ID only.
Then the code in ListUsageController::getRows() treats the source ID as a single row, and then only checks all of the other records to determine if one of them is the default revision. It loads the default source entity and always displays its language in the usage report's column.

  1. If a different target is referenced only on the source translation (Spanish), then the output still displays default language (English) even though the target may not be referenced on the English source. Expected result: The usage row should show the translation language, ex "Spanish".
  2. If the target is the same on both the source default translation and other translations, then it will always find the default revision in the usage records. Should there not be a usage row for each translation?

Steps to reproduce

Different target on translations:

  • Create a node in the default language (ex English), reference a media image, and save the page
  • Add a translation for the node (ex Spanish) and change the media image reference to a different image than the English node.
  • View the usage list page for the media referenced on the Spanish node.
  • BUG: The usage is displayed but shows the language as "English" with the "Used In" column as "Translations or previous revisions". Expected result: The language column should state "Spanish".

Same target on both translations:

  • Create a node in the default language (ex English), reference a media image, and save the page
  • Add a translation for the node (ex Spanish) with the same media image reference.
  • View the usage list page for the media
  • BUG?: Only the default English language source will be displayed. Expected result: A row for each translation.
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇺🇸United States recrit

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024