Allow flagging translations as outdated when content is moderated

Created on 7 March 2018, over 6 years ago
Updated 18 September 2024, 2 months ago

Problem/Motivation

In #2949815: Flagging translations as outdated in a pending revision causes multiple translations to be marked as affected we have hidden the "Flag as outdated" functionality for moderated content due to how late this issue was discovered in the 8.5 development cycle, however this feature is not fundamentally incompatible with pending revisions so we should try to bring it back.

Proposed resolution

An attempt was made to save a new revision for every translation, however it was deemed too risky and not tested enough to be committed.

Remaining tasks

  • Propose a valid solution
  • Write a patch
  • Reviews

User interface changes

The "Flag as outdated" checkbox is restored.

API changes

None

Data model changes

None

📌 Task
Status

Needs work

Version

11.0 🔥

Component
Content translation 

Last updated about 16 hours ago

No maintainer
Created by

🇮🇹Italy plach Venezia

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.

  • 🇮🇳India sanket1007

    Couldn't apply the patch #14 in latest Drupal version 10.3.1

  • 🇷🇴Romania Kosa Ilma

    I can confirm @sanket1007
    I have tried on Drupal core 10.3.1 and it is working without the addition of the patch.

  • First commit to issue fork.
  • 🇺🇸United States charginghawk

    Unable to test 10.3 right now, but it seems like the outdated option should still be unavailable since the logic hiding it is still there:

    https://git.drupalcode.org/project/drupal/-/blob/11.0.4/core/modules/con...

    In any case that code should be removed. Also, we should have steps to reproduce.

    Additionally, as a commenter noted, "Why does a new revision need to be created to mark it as outdated?" It doesn't. The condition at the end of markRevisionTranslationsOutdated() should use setSyncing(TRUE) to mark the latest translation affected revision as outdated:

          $revision_id = $storage->getLatestTranslationAffectedRevisionId($entity_id, $langcode);
          if (!$revision_id) {
            continue;
          }
    
          /** @var \Drupal\Core\Entity\ContentEntityInterface $revision */
          $revision = $storage->loadRevision($revision_id);
          $revision_translation = $revision->getTranslation($langcode);
          $metadata = $this->manager->getTranslationMetadata($revision_translation);
          if (!$metadata->isOutdated()) {
            $metadata->setOutdated(TRUE);
            $revision_translation->setSyncing(TRUE);
            $storage->save($revision_translation);
          }
    
Production build 0.71.5 2024