Skip to content

Commit

Permalink
Fixed issue #10052: 0 as answer code in radio list causes problems wh…
Browse files Browse the repository at this point in the history
…en 'No answer' is enabled

Dev: Replaces (!$var) with !isset($var) to cope with situations where $var = 0
Dev: Fix only for radio list HTML rendering. Similar issues may exist for other question types
  • Loading branch information
Adam Webb committed Nov 19, 2015
1 parent d0489fd commit 690fc31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/qanda_helper.php
Expand Up @@ -1789,7 +1789,7 @@ function do_list_radio($ia)

if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
if ((!$_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == '') || ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == ' ' ))
if ((!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == '') || ($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == ' ' ))
{
$check_ans = CHECKED; //Check the "no answer" radio button if there is no answer in session.
}
Expand Down Expand Up @@ -1893,7 +1893,7 @@ function do_listwithcomment($ia)

if ($ia[6] != 'Y' && SHOW_NO_ANSWER == 1)
{
if ((!$_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == '') ||($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == ' ' ))
if ((!isset($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]]) || $_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == '') ||($_SESSION['survey_'.Yii::app()->getConfig('surveyID')][$ia[1]] == ' ' ))
{
$check_ans = CHECKED;
}
Expand Down

0 comments on commit 690fc31

Please sign in to comment.