Problems with viewing draft translations using node_authlink

Created on 5 August 2020, over 4 years ago
Updated 11 August 2023, over 1 year ago

Problem/Motivation

It is not possible to view a draft of a node translation using this module for a couple of reasons:

1. The selector on the form shows default language revisions even when viewed from another interface language

2. If you manually type the correct revision id into the url it still does not work due to an incompatibility with content_translations which removes any translation languages from the candidate languages on node view

Steps to reproduce

1. Create a content-type, turn on translation and enable node_authlink
2. Create a node in the default language (en) and set it to published
3. Translate the node (fr), set to published
4. Create a draft version of the in en and save
5. Translate the and save a draft in fr
6. Go to Authlink tab in en and see revision in dropdown
7. Change interface language to fr and see same revisions as en in dropdown (problem #1)
8. Select an authlink from 7 and go to that url from a different browser
9. Change the revision id to the draft fr revision id in the url and see that you get the published en version of the page

Proposed resolution

Patch to follow.

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇨🇦Canada joel_osc

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.

  • 🇪🇸Spain tunic Madrid

    Hi @joel_osc, thanks for the bug report.

    I'm not sure I understand the patch. You say that the "French options contain incorrect vids" but currently the langcode is only used to "show revisions that are affected by the language that is being displayed."

    The module uses this check:

    if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {

    When the links are created no langcode is used.

    This patch seems to use the interface langcode to filter available translations, so if for example you are in English interface you will only see revisions in English.

    I know the translation system less than I would like so maybe I'm missing something here.

    I'm working on the Drupal 10 release and I'll be happy to fix this there as well but I need more info to be sure what I'm doing.

  • Status changed to Closed: outdated 4 months ago
  • 🇨🇦Canada joel_osc

    Just noticed this issue (years later, sorry!), going to close it out as outdated. Still seeing some issues with multilingual content that is using content moderation. I will open up new issues as I characterize them... thank-you for your work on this module!

  • 🇪🇸Spain tunic Madrid

    Thanks for coming back and close the issue!

    If you track down the mentioned issues to this module don't hesitate to open a new one.

Production build 0.71.5 2024