Skip to content

Commit

Permalink
Fixed issue #05756: Activate Survey screen always in primary language
Browse files Browse the repository at this point in the history
Fixed issue #05802: Importing Survey Switches UI language
Dev Root problem was that CreateFieldMap might change language, but not restore $clang to be admin language - e.g. real root problem is use of global variables
  • Loading branch information
TMSWhite committed Feb 22, 2012
1 parent 2c6a7f9 commit e14794b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions common_functions.php
Expand Up @@ -2287,6 +2287,9 @@ function createFieldMap($surveyid, $style='full', $force_refresh=false, $questio

//checks to see if fieldmap has already been built for this page.
if (isset($_SESSION['fieldmap-' . $surveyid . $s_lang]) && !$force_refresh) {
if (isset($_SESSION['adminlang']) && $clang->langcode != $_SESSION['adminlang']) {
$clang = new limesurvey_lang($_SESSION['adminlang']);
}
return $_SESSION['fieldmap-' . $surveyid . $s_lang];
}

Expand Down Expand Up @@ -2835,6 +2838,10 @@ function createFieldMap($surveyid, $style='full', $force_refresh=false, $questio
}
if (isset($fieldmap)) {
$_SESSION['fieldmap-' . $surveyid . $clang->langcode]=$fieldmap;

if (isset($_SESSION['adminlang']) && $clang->langcode != $_SESSION['adminlang']) {
$clang = new limesurvey_lang($_SESSION['adminlang']);
}
return $fieldmap;
}
}
Expand Down

0 comments on commit e14794b

Please sign in to comment.