Language detection based on session doesn't work with URL aliases

Created on 29 September 2011, about 13 years ago
Updated 21 October 2023, about 1 year ago

Problem/Motivation

- Path module doesn't take into consideration the language when using session for detection, when using url prefix it works.
- Translation switch links in node's view doesn't output the alias of the translated nodes, it just print a plain url (e.g. node/3 instead of node/alias)

Steps to reproduce

  • Add a language, e.g. Spanish (es), detect the language using session.
  • Add a node, translate it, and set the translated node alias to something 'foo'
  • View the original node, the href of translated node link appears without the alias (e.g. node/2).
  • Try manually to go to 'foo', doesn't work.

Proposed resolution

- Allow Path module to detect the language from the global $language variable instead of $language_url
- Edit translation_language_switch_links_alter() to make it use url() instead of forming hard coded url.

Remaining tasks

Write a test to show how it failed to request a path alias for translated node when using session to detect the language, and to show how translated links are not using aliases.

User interface changes

None.

API changes

None.

Original report by [username]

Vapes

πŸ› Bug report
Status

Closed: duplicate

Version

8.8 ⚰️

Component
Language systemΒ  β†’

Last updated about 7 hours ago

  • Maintained by
  • πŸ‡©πŸ‡ͺGermany @sun
Created by

πŸ‡ΊπŸ‡ΈUnited States Vapes

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

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.

  • πŸ‡¦πŸ‡ͺUnited Arab Emirates Double Vapo dubai dragon mart

    Welcome to DoubleVapo Store Dubai UAE online vape shop. We are UAE based online vape shop. You can order all types of IQOS devices, Heets, and Disposable Vape from us .
    We have Cash On Delivery available to Abu Dhabi, Dubai, Sharjah, Ajman, Umm Al Quwain, Ras Al Khaimah, Fujairah
    Double Vapo

Production build 0.71.5 2024