Content language and translation AJAX expansion is backwards

Created on 12 January 2024, about 2 months ago
Updated 23 February 2024, 8 days ago


In Drupal 10.2, the expansion of entity types selected (and not selected) for translation is backwards.

How it looks in Drupal 10.1

How it looks in Drupal 10.2

Steps to reproduce

  1. Install Drupal with the basic profile.
  2. Enable the language and content translation modules.
  3. Add a second language. I have been adding Spanish
  4. Go to Configuration > Region and language > Content translation
  5. Under "Custom language settings" click on "Content"
  6. Expand "Content" and click the checkbox next to "Article"
  7. The available fields will expand under "Article"
  8. Click "Save configuration" at the bottom of the page
  9. Expand the "Content" area again.
  10. The fields under "Article", which is checked, will not be expanded.
  11. The fields under "Basic page", which is not checked, will be expanded.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report




Content translation 

Last updated 2 days ago

No maintainer
Created by

🇺🇸United States RoloDMonkey

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates : some issue and comment data are missing.

  • Issue created by @RoloDMonkey
  • First commit to issue fork.
  • 🇮🇳India shalini_jha

    HI @RoloDMonkey

    I have followed the steps and able to reproduce the issue.
    for debugging this issue i have added one more content type called "blog post". so it is expending the field under blog post and all the fields under newly created content type is checked. please suggest the expected behaviour ?

  • 🇺🇸United States RoloDMonkey

    Expected behavior:

    When the main entity type, like Article, is translatable the fields under the article should always be expanded. On the other hand, if the translatable checkbox next to an entity type is not checked then its fields should not be visible.

    The fields will become visible if you are clicking the translatable checkbox for the first time, or if you turn it off and then back on again. But, they are not expanded when the page first loads. That is why I marked this as a major issue, because right now there isn't a way to accurately view and manage which fields are translatable through the UI.

  • First commit to issue fork.
  • Merge request !6256Update file content_translation.admin.js → (Open) created by joco_sp
  • 🇸🇮Slovenia joco_sp

    I have the same issue as RoloDMonkey. I did a change in the core/modules/content_translation/content_translation.admin.js -> #7. It worked for me. I didn't do an extensive test of it. So, I don't know if it's the right way or if this opens new problems, but it worked on my project.

  • Status changed to Needs review about 1 month ago
  • Pipeline finished with Success
    about 1 month ago
    Total: 627s
  • Status changed to Needs work about 1 month ago
  • The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Status changed to RTBC 29 days ago
  • 🇸🇮Slovenia joco_sp

    We applied the patch on multiple websites (also on version 10.2.2) and it seams that the patch solved that issue for us.

  • 🇨🇭Switzerland tcrawford

    I applied the patch, but this initially did fix the issue. I was however also seeing a TypeError in the console (L:64 of content_translation.admin.js) as $element[0] was undefined. I am not sure if this is related at all, but mention it in case others are seeing it. After adding a separate patch for the type error this patch addressed the issue. Thank you!

  • 🇺🇸United States RoloDMonkey

    The other error when $element[0] is empty is not directly related to this one.

    I created 🐛 Javascript warning from content language and translation page Needs work for that error, and provided a fix.

  • First commit to issue fork.
  • 🇫🇷France nod_ Lille

    this was a mistake in 📌 Refactor (if feasible) use of jquery is function to use vanillaJS Fixed , updated the code to reflect what there before

    • nod_ committed 223f5c0a on 11.x
      Issue #3414415 by joco_sp, nod_, RoloDMonkey, tcrawford: Content...
    • nod_ committed 61bc6f8e on 10.3.x
      Issue #3414415 by joco_sp, nod_, RoloDMonkey, tcrawford: Content...
  • Status changed to Fixed 8 days ago
  • 🇫🇷France nod_ Lille

    Committed 223f5c0 and pushed to 11.x. Thanks!

Production build 0.61.6-2-g546bc20