Skip to content

Commit

Permalink
Fixed issue #4582: Array filter no properly working in all in one and…
Browse files Browse the repository at this point in the history
… group-by-group mode

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@9237 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 13, 2010
1 parent b8f157f commit 70fb0df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion group.php
Expand Up @@ -896,7 +896,7 @@ function checkconditions(value, name, type)
{
$qquery = "SELECT {$dbprefix}answers.code as title, {$dbprefix}questions.type, {$dbprefix}questions.other FROM {$dbprefix}answers, {$dbprefix}questions WHERE {$dbprefix}answers.qid={$dbprefix}questions.qid AND {$dbprefix}answers.qid='".$attralist['qid']."' AND {$dbprefix}answers.language='".$_SESSION['s_lang']."' order by code;";
} else {
$qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE parent_qid='".$attralist['qid']."' AND language='".$_SESSION['s_lang']."' order by title;";
$qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE parent_qid='".$attralist['qid']."' AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
}
$qresult = db_execute_assoc($qquery); //Checked
$other=null;
Expand Down
5 changes: 3 additions & 2 deletions qanda.php
Expand Up @@ -375,7 +375,8 @@ function setman_multiflex($ia)

global $dbprefix, $connect;


$mandatorys=array();
$mandatoryfns=array();
$ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' and scale_id=0 ORDER BY question_order, title";
$ansresult = db_execute_assoc($ansquery);
$ans2query = "SELECT * FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' and scale_id=1 ORDER BY question_order, title";
Expand Down Expand Up @@ -412,7 +413,7 @@ function setman_multiflex($ia)
{
//This particular one may not be mandatory if it's hidden
$selected = getArrayFilterExcludesForQuestion($ia[0]);
if (in_array($ansrow['title'],$selected))
if ($selected!=false && in_array($ansrow['title'],$selected))
{
//This one's hidden, so don't add it to the mandatory list
}
Expand Down
2 changes: 1 addition & 1 deletion survey.php
Expand Up @@ -760,7 +760,7 @@ function checkconditions(value, name, type)
{
$qquery = "SELECT {$dbprefix}answers.code as title, {$dbprefix}questions.type, {$dbprefix}questions.other FROM {$dbprefix}answers, {$dbprefix}questions WHERE {$dbprefix}answers.qid={$dbprefix}questions.qid AND {$dbprefix}answers.qid='".$attralist['qid']."' AND {$dbprefix}answers.language='".$_SESSION['s_lang']."' order by code;";
} else {
$qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE parent_qid='".$attralist['qid']."' AND language='".$_SESSION['s_lang']."' order by title;";
$qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE parent_qid='".$attralist['qid']."' AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
}
$qresult = db_execute_assoc($qquery); //Checked
$other=null;
Expand Down

0 comments on commit 70fb0df

Please sign in to comment.