Skip to content

Content Translation blanks language switcher link query parameters #7133

@elisseck

Description

@elisseck

Description of the bug

This is a follow-up to #5342

The change there blanks out necessary query parameters from language switcher links when using the "request/session" detection method and the "Content Translation" module is turned on.

Steps To Reproduce

To reproduce the behavior:

  1. Install a blank latest Backdrop site
  2. Turn on the "Language" and "Locale" modules
  3. At admin/config/regional/language enable one or more additional languages
  4. At admin/config/regional/language/detection enable "Session" and set it as your primary detection mode
  5. In your layout (e.g. admin/structure/layouts/manage/home) place the "Language switcher (User interface text)" block and "Save" your layout
  6. Observe the links in the block correctly print a query parameter to switch your language (e.g. https://backdrop_translation.local/?language=es)
  7. Turn on the "Content Translation" module
  8. Observe the links in the block no longer correctly print a query parameter to switch your language (e.g. https://backdrop_translation.local/) and cannot be used to switch UI language any longer.

Actual behavior

Language switcher links using "Session" detection mode are rendered without the necessary query parameters to function when the Content Translation module is turned on.

Expected behavior

Language switcher links using "Session" detection mode are rendered with the necessary query parameters to function when the Content Translation module is turned on, but additionally retain current page query parameters i.e. do not create a regression of #5342, I do think that was a positive change overall.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions