Issue Bug Closed

#49499TypoScriptFrontendController->initLLvars issue

Popy no-lastname-given 06/28/13, 17:31 updated 10/02/18, 12:12

Description

(Every method I’ll speak about are in TypoScriptFrontendController class)

Currently, ->initLLvars is called from ->getConfigArray, which is called from index_ts.php a few lines before ->settingLanguage.

Because of that and the fact that ->initLLvars does not reinit ->languageDependencies before filling it can cause some issue, especially if english is not the default sys_language, when one uses ->settingLanguage hooks to init language (instead of typoscript conditions)

For instance :
  • My website is French / English, and i’ll visit the English version
  • initLLVars fills ->languageDependencies with ‘fr’
  • ->settingLanguage hook properly sets the current language
  • as it have to, the hook calls ->initLLVars again. Which does not empty ->languageDependencies before adding nothing to it.

So, in this case, I end up with a ->languageDependencies = array(‘fr’), which results into french labels on my english website version.

Solutions are :
  • Move ->initLLVars call somewhere in ->settingLanguage (where it should belong, IMO). Problem here is that maybe ->convPOSTCharset will have to be moved after the language init (it depends on ->initLLvars because of charsets) so it could be difficult to test.
  • add “$this->languageDependencies = array()” at the beginning of ->initLLVars in order to … init ll vars (what is what we should expect from it, no ?)

Reviews 3