UI and functionality for translated "Authored by" is confusing or broken

Created on 13 February 2019, about 6 years ago
Updated 29 January 2025, 3 months ago

Problem/Motivation

This is a follow up to an issue reported to the Drupal Security Team, but it's been decided this can be dealt with in a public issue.

Core's Content Translation module allows for the "Authored by" field to be translatable for a given content type (see this blog post by GΓ‘bor Hojtsy which is a few years old but still seems to reflect the current state of this functionality).

However, whether "Authored by" is set to be translatable or not, and whether the "Hide non translatable fields on translation forms" option is selected or not, it seems that the "Authored by" field always appears in the node edit/translation form and it seems like users can change the value (including the autocomplete functionality which looks up users and adds their uid to the input). Changing this value in the edit/translate form doesn't actually seem to change the value which is displayed in the "Submitted by" field when viewing the translation of the node as far as I can see, which seems quite confusing.

The "Submitted by" field displayed when viewing a node does reflect the (original?) author of the translation if "Authored by" is set to be translatable for that content type, but even in that case changing the value in the edit/translation form doesn't seem to change the user shown as having "Submitted" the translation.

This is all quite confusing for the user(s).

Steps to reproduce

  • Enable Content Translation and dependencies on a blank D8 site.
  • Add a 2nd language (e.g. French), leave English as the default.
  • Edit content language settings (/admin/config/regional/content-language) for a content type (e.g. Article) and make "Authored by" translatable.
  • Add three test users (foo, bar, baz) with no special roles.
    • for u in foo bar baz; do drush ucrt $u ; done
  • Grant authenticated users permissions to Article: Create new content, Create translations, Edit translations, Translate Article content.
  • As foo create a new article with some basic content in English.
  • As bar translate the article into French.
  • As baz observe the "Submitted by" value on the article and its translation (bar submitted it).
  • As bar edit the translation of the article, and try to change the "Authored by" value to one of the other users (e.g. foo).
  • As baz observe the "Submitted by" value on the article and its translation (should be foo).
  • Edit the content language settings again and disable the translatable option for "Authored by" on the content type.
  • Repeat the create / translate / edit steps above as the different users.
  • Edit the content language settings again and enable the "Hide non translatable fields on translation forms" option.
  • Observe that all of the users can still see and edit the "Authored by" field when editing translations.

Other variations on these steps include changing the "Authored by" on a translation when that field is set as translatable, but as a user other than the original author and translator. This doesn't seem to do anything. I think we've enumerated enough steps and combinations to make the point now though.

Proposed resolution

If the value cannot be changed, the field shouldn't appear in the form. If it should be possible to change the value, doing so in the edit form should be reflected in the values displayed when viewing the translation.

Remaining tasks

  • Identify whether one or more bugs are causing the apparently confusing UI.
  • Fix those bugs.

User interface changes

TBC

API changes

TBC

Data model changes

TBC

Release notes snippet

TBC

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

content_translation.module

Created by

πŸ‡¬πŸ‡§United Kingdom mcdruid πŸ‡¬πŸ‡§πŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

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.

  • πŸ‡ΊπŸ‡ΈUnited States lhridley

    So, I just tried to duplicate this issue with a fresh D11 site install, walking through the steps that the OP outlined. I am not able to edit the "Authored by" field through the UI, even though it is set to translatable in the configuration. This appears to be the case whether or not the "Hide non translatable fields on translation forms".

    The test users in this test case are testuser1 (language English), testuser2 (language Spanish), and testuser3 (language English)

    Basic page is configured for translations, and content type is configured to display the author by and authored on date on the Basic page entity. Revisions are being tracked.

    English content (original) created by testuser1.
    Spanish content translated by testuser2.
    English content is revised by admin user (user 1).

    testuser1 always shows as the author for the English version, and testuser2 always shows as the author for the translated version. Once the initial nodes are created, even with revisions to the English content by the "admin" user (user 1) the authored by field remains unchanged.

    So...I can only draw the conclusion that the "Authored by" field is no longer exposed for translations (which seems logical to me).

    However, if this is the case, then the "Authored by" field shouldn't appear on the translation configuration options for the content type.

Production build 0.71.5 2024