Permalink
Browse files

Fixed issue : #6319 Previewgroup can throw error

Dev: fixed issue : set $_SESSION['s_lang'] according to existing survey langage (if unique)
Dev : not sure we use function SetSurveyLanguage
  • Loading branch information...
1 parent afbed20 commit 3aeb418cdb3e69e72d8b21c4e707961806bbe580 @Shnoulle Shnoulle committed Aug 10, 2012
Showing with 9 additions and 7 deletions.
  1. +9 −7 application/helpers/frontend_helper.php
@@ -2835,15 +2835,17 @@ function SetSurveyLanguage($surveyid, $language)
$default_language = $row->language;
}
- if (!isset($language) || ($language=='') || (isset($additional_languages) && strpos($additional_languages, $language) === false)
- or (isset($default_language) && $default_language == $language)
- ) {
- // Language not supported, or default language for survey, fall back to survey's default language
+ if (!isset($language) || ($language=='')
+ || (isset($additional_languages) && strpos($additional_languages, $language) === false)
+ || (isset($default_language) && $default_language == $language)
+ )
+ {
+ // Language not supported, fall back to survey's default language
$_SESSION['survey_'.$surveyid]['s_lang'] = $default_language;
- //echo "Language not supported, resorting to ".$_SESSION['s_lang']."<br />";
- } else {
+ }
+ else
+ {
$_SESSION['survey_'.$surveyid]['s_lang'] = $language;
- //echo "Language will be set to ".$_SESSION['s_lang']."<br />";
}
Yii::import('application.libraries.Limesurvey_lang', true);
$clang = new limesurvey_lang($_SESSION['survey_'.$surveyid]['s_lang']);

0 comments on commit 3aeb418

Please sign in to comment.