Allow flagging translations as outdated when content is moderated

Created on 7 March 2018, over 7 years ago
Updated 23 July 2024, about 1 year 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 16 days 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);
          }
    
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States charginghawk

    Rerolling #14 for 10.3.x. Also adding the "setSyncing(TRUE)" described above to setOutdated on the current revision instead of creating a new one.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Thanks for continuing. Patch should be in an MR though vs patch.

  • Status changed to Needs work 4 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States banoodle San Francisco, CA

    Pach #14 doesn't apply on 11.1.5.

    I re-rolled the patch locally so it applies, but then I get timeout errors when I save nodes with "translations outdated" enabled.

    I would submit a MR, but for some reason I don't have sufficient privileges (I'm working to resolve that now).

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States banoodle San Francisco, CA

    Here is a re-rolled patch that works on D11.1.5.

    I realize you prefer an MR. I will try to make one tomorrow once I sort out my permissions/account issues.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States banoodle San Francisco, CA

    Update: even though patch 25 works fine in my local, when I deploy it to Pantheon, I still get "The application did not respond in time." when trying to save a node with the "outdated" option enabled.

  • ๐Ÿ‡จ๐Ÿ‡ดColombia yovanny.gomez.oyola

    Patch #22 works well on Drupal 10.3.x. However, I noticed that when a translation is marked using the "Flag other translations as outdated" option, the "This translation needs to be updated" field does not appear when loading the other translations.

    To address this, Iโ€™ve added a small tweak to Patch #22 to ensure the field is displayed correctly and behaves as expectedโ€”just like it does when the content is not moderated.

    Iโ€™ve attached screenshots showing the behavior after applying the new patch.

Production build 0.71.5 2024