Skip to content

Commit

Permalink
Fixed bug #3250: Array not being returned when code_filter chosen
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey@7028 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Jun 5, 2009
1 parent cf4a82b commit a4a3a35
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions qanda.php
Expand Up @@ -1268,6 +1268,7 @@ function do_list_dropdown($ia)

$answer .= ' </optgroup>';
}
$opt_select='';
foreach ($defaultopts as $optionarray)
{
if ($_SESSION[$ia[1]] == $optionarray['code'])
Expand Down Expand Up @@ -1435,7 +1436,7 @@ function do_list_flexible_dropdown($ia)
if ($code_filter=arraySearchByKey('code_filter', $qidattributes, 'attribute', 1))
{
$filter=$code_filter['value'];
if(in_array($filter, $_SESSION['insertarray']))
if(isset($_SESSION['insertarray']) && in_array($filter, $_SESSION['insertarray']))
{
$filter=trim($_SESSION[$filter]);
}
Expand Down Expand Up @@ -1464,9 +1465,10 @@ function do_list_flexible_dropdown($ia)

if (labelset_exists($lid,$_SESSION['s_lang']))
{
$opt_select='';
while ($ansrow = $ansresult->FetchRow())
{
if ($_SESSION[$ia[1]] == $ansrow['code'])
if ($_SESSION[$ia[1]] == $ansrow['code'])
{
$opt_select = SELECTED;
}
Expand All @@ -1479,7 +1481,7 @@ function do_list_flexible_dropdown($ia)

if (!$_SESSION[$ia[1]] && (!isset($defexists) || !$defexists))
{
$answer = ' <option value=""'.$opt_select.'>'.$clang->gT('Please choose')."...</option>\n".$answer;
$answer = ' <option value="" '.$opt_select.'>'.$clang->gT('Please choose')."...</option>\n".$answer;
}

if (isset($other) && $other=='Y')
Expand All @@ -1503,7 +1505,7 @@ function do_list_flexible_dropdown($ia)
}
else
{
$answer .= ' <option>'.$clang->gT('Error: The labelset used for this question is not available in this language.').'</option>
$answer .= ' <option>'.$clang->gT('Error: The labelset used for this question is not available in this language.').$_SESSION['s_lang'].'</option>
';
}

Expand Down Expand Up @@ -1844,7 +1846,7 @@ function do_list_flexible_radio($ia)
if ($code_filter=arraySearchByKey("code_filter", $qidattributes, "attribute", 1))
{
$filter=$code_filter['value'];
if(in_array($filter, $_SESSION['insertarray']))
if(isset($_SESSION['insertarray']) && in_array($filter, $_SESSION['insertarray']))
{
$filter=trim($_SESSION[$filter]);
}
Expand Down

0 comments on commit a4a3a35

Please sign in to comment.