LanguageNegotiationContentEntity: don't break interface language switcher links

Created on 25 March 2017, over 7 years ago
Updated 30 January 2023, over 1 year ago

Hi,

when "Content" language negotiation is enabled the links in the interface language switcher are broken, in particular they never allow to change the interface language (see also #2860901: Doubts about Content language negotiation ).

Look at the images below:

This is because LanguageNegotiationContentEntity::processOutbound() unsets $options['language'] and this means that the current url language prefix would be forced in the generated links, as stated in Url::fromUri under "Parameters", array $options, 'language'.

A way to fix this could be to mark in some way that the URLs come from another language switcher, and in that case leave them alone.

A "proof of concept" patch is on its way.

Thanks,
Antonio

🐛 Bug report
Status

Needs work

Version

10.1

Component
Language module 

Last updated 1 day ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇮🇹Italy ao2

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

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

Production build 0.71.5 2024