Metatag Field breaks Content Translation with Content Moderation enabled, and field is untranslateable

Created on 9 November 2018, over 6 years ago
Updated 4 December 2023, over 1 year ago

Problem/Motivation

When using a metatag field for a content type, that supports content translation and uses content moderation, the translation cannot be saved and is blocked by the error message:

Non-translatable fields can only be changed when updating the original language.

It only happens, when the translation for the metatag field is not enabled.

Steps to reproduce

  1. Install Drupal with the standard profile
  2. Enable metatag and Core's content_translation and content_moderation
  3. Add a secondary language add /admin/config/regional/language
  4. Enable translation for the article content type at /admin/structure/types/manage/article
  5. Add a Metatag field at /admin/structure/types/manage/article/fields
  6. Add a new article in the default language and set the moderation state to "Published"
  7. Try to translate the new article to the secondary language. When saving you should see the error message

The issue can be workaround, by enabling the field translation for the metatag field from /admin/structure/types/manage/article/fields

There are good reasons, to make the metatag field translatable, but as I'm using tokens only in metatags, I didn't thought it is necessary and so the issue was not quite obvious for me.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇩🇪Germany szeidler Berlin

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024