Flag "revision_translation_affected" is not always set correctly

Created on 27 January 2025, 25 days ago

Problem/Motivation

There are revisions where the “revision_translation_affected” flag is not set for any translation within a given revision. This seems incorrect, as at least one translation should always be marked as affected.

Steps to reproduce

Create content moderations setup where you have 3 states: archived (status = 0), draft (status = 0) and published (status = 1).
Enable content moderation using these 3 statuses.
Create entity with content moderation equals to draft.
Use views_bulk_edit and archive the entity.
Flag "revision_translation_affected" is not set, while this change is related to given revision.
It's because content moderation are separate entities and as we change from draft to archived, there is no change in fields on entity itself. But this change is related to this revision.
As result, e.g. this revision is not visible on Revisions tab.

Proposed resolution

The simplest way is set "revision_translation_affected" manually. It might be, that better improvement could be to use approach like on ScheduledTransitions module: https://git.drupalcode.org/project/scheduled_transitions/-/blob/2.8.x/sr... In short:

// Creating revisions via createRevision to invoke
// setRevisionTranslationAffected and whatever other logic doesn't happen
// automatically by simply setting setNewRevision on its own.
// 'default' param: will be changed by content moderation anyway, and
// ->setNewRevision() is called.
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇵🇱Poland gugalamaciek

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

Comments & Activities

Production build 0.71.5 2024