The getModerationState() function fails to take translations into consideration

Created on 5 October 2018, over 5 years ago
Updated 2 June 2024, 23 days ago

Steps to reproduce:

  • Install Drupal 10.2.6
  • Enable a second language (any language)
  • configure a language prefix to determine current language
  • enable translation on a node bundle
  • enable revisioning on that node bundle
  • install the diff module and configure it
  • create content in that node bundle
  • translate that content
  • go to the revisions tab
  • Notice that Revision histories of translated nodes are not being taken into account. For instance, when I am viewing a node with the following url structure: /{langcode}/node/{vid}/revisions

SOLUTION:
Apply the patch β†’

Revision histories of translated nodes are not being taken into account. For instance, when I am viewing a node with the following url structure:

/{langcode}/node/{vid}/revisions,

The current logic of $entity->moderation_state->value within the getModerationState() function fails to take into consideration the loaded language of the node in question. By default, the published states reflect the original node language revisions NOT the language specified by {langcode}.

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States toiletfinder.com

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

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.69.0 2024