Comparison routes should load the latest entity revision in the current language

Created on 30 January 2024, 11 months ago

Problem/Motivation

The comparison route for nodes "diff.revisions_diff" loads the default revision in the default revision's language. This causes a bug when viewing the revision comparison for a translation. The navigation incorrectly allows navigating to next / previous changes of revisions that are not for the translation in the current content language.

Steps to reproduce

  • Create a node in the default language, example English.
  • Create some revisions for the English translation.
  • Add a Spanish translation
  • Create some revisions for the Spanish translation
  • View the Revisions for the Spanish translation. Note: Test with πŸ› Revisions log on translated nodes should not show original language revisions, should show revisions of translated content RTBC which has been merged now. This limits the revisions to only revisions for the current content language.
  • Compare two revisions of the Spanish translation.
  • Click the "Previous Change" link in the Diff comparison Navigation.
  • Bug: You will be able to navigate through all revisions - English and Spanish.

Proposed resolution

Load the latest entity in the current content language so that the Drupal\diff\Controller\PluginRevisionController has the correct language to build the revision IDs for the navigation.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

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

Production build 0.71.5 2024