Review main Merged

23529[BUGFIX] Fix possible language handling issue

Popy CR +2 V +2 Easy +9 −4 updated 02/17/14, 16:04

Commit message

The language initialization process is currently split in two main
methods (TypoScriptFrontendController->initLLvars and ->settingLanguage).

Only settingLanguage contains hooks and sets the "sys_language_uid"
property (and "sys_language_content") which determine the displayed
records in Frontend. On the opposite, initLLvars is not hookable and sets
the "lang" property, which may be used by charset conversion methods.

In order to determine display language within hooks, the only way
currently is to call initLLvars a second time after determining language,
but this method populates the "languageDependencies" property without
initializing it. So it is filled two times, which leads to incorrect
labels, especially if the displayed language is English and the
default language is not English (as "languageDependencies" is already
filled with "default language").

The three parts of the patch are:
 * The initLLvars method now pre-initializes the "languageDependencies"
   property.
 * The initLLvars is now called from "settingLanguage" method, right
   after the "settingLanguage_preProcess" hook to avoid a second call it.
 * The convPOSTCharset call is now moved after the language
   initialization, as the language determination done by initLLvars
   can have some impact on charset handling (multi-charset locallang.php
   legacy).

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 2