Background:
I have a multilingual site with 3 languages(English-default, French and Spanish). It is a vanilla drupal 7.26 site with i18n, Multilingual content, and paths. With some other language modules that do not affect the path.

Setup:
If I create a basic page and make its language english and give it a url of 'testing-path' when I goto example.com/testing-path I will see the english version of the node. I then click the translate tag and make a spanish version and a french version of the page. I make the paths the same for each node 'testing-path'. This is allowed because they are different languages. So now i have as follows:
English(en)- example.com/node/3 ---> example.com/testing-path
French(fr)- example.com/node/4 ---> example.com/testing-path
Spanish(es)- example.com/node/5 ---> example.com/testing-path
This can be confirmed on the url alias admin page example.com/admin/config/search/path

Problem:
In the file /includes/path.inc, the function drupal_path_initialize sets the $_GET['q']. So when I goto example.com/testing-path it changes the $_GET['q'] to node/3. All the time. No matter the language. This is because the function drupal_path_initialize uses the the function drupal_get_normal_path without passing in the language. drupal_get_normal_path has support for a language code and by default sets it to NULL. This results in the incorrect node url being set for $_GET['q'].

Reasons this is a problem:
Using contrib modules like, global redirect I am allowed to redirect based on a language. So if my language is set to ?language=fr(or which ever way you are storing the language) I would goto 'node/4'(the node corresponding with the language). Because the incorrect node is being set in the $_GET['q'] there is a disconnect to what url Drupal is saying you are on and URL the language + node thinks it should be.

Solution:
Get the global variable language in the function drupal_path_initialize and pass drupal_get_normal_path the correct language code so the correct node is placed in $_GET['q'] from the start of the request.

CommentFileSizeAuthor
#1 drupal_path_initialize-2237121-1.patch702 bytesjpitassi
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jpitassi’s picture

Version: 7.26 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.