Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: How is $language set?

How is $language set? 4 years 9 months ago #74630

  • tacman1123
  • tacman1123's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 125
  • Thank you received: 1
  • Karma: 1
I'm trying to track down some language-related bugs, and am wondering how $language is set. If I'm logged in with my base language set to 'English', working on a survey with a base language of 'Vietnamese', and I'm running the statistics report, the select box for choose from a list of answers is generated in statistics.php with the code
//get answers
$query = "SELECT code, answer FROM ".db_table_name("answers")." WHERE qid='$flt[0]' AND language='{$language}' ORDER BY sortorder, answer";

I'm thinking that $language might be set based on cookies, a post or get request, session, something like that, and maybe there's something unexpected in my configuration for prioritizing globals. I have this is a bug report, but maybe it's hard to reproduce with different environments. For example, right now when I import a survey with a base language other than English, but whole UI switches, at least until I move to another section of admin.

The administrator has disabled public write access.
Time to create page: 0.287 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form