No interface language switch links available on the content translation 'add' form

Created on 2 October 2025, 19 days ago

Problem/Motivation

Interface language switch links check access to the URL in the target language.

On the content translation 'add' form, access is denied because the entity in the route has been modified with a new translation in \Drupal\content_translation\Controller\ContentTranslationController::add

Steps to reproduce

  1. Enable 'Content translation' and language modules
  2. Add another language, for example French: /admin/config/regional/content-language
  3. Assign 'Language Switcher' block in to a region.
  4. Create a 'Basic Page' content and visit the 'Add translation' page: /en/node/1/translations/add/en/fr
  5. Notice no language switch links are available

Proposed resolution

Add the new translation to a clone of the entity, so the entity in the route object is not modified

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

Language switch links are available on the 'Add translation' page

API changes

None

Data model changes

None

Release notes snippet

None

🐛 Bug report
Status

RTBC

Version

11.0 🔥

Component

content_translation.module

Created by

🇳🇱Netherlands idebr

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.

No activities found.

Production build 0.71.5 2024