Skip to content

Commit

Permalink
Fixed issue #09271: Array dual scale causes errors
Browse files Browse the repository at this point in the history
Dev: Due to attribute language in 2.0
  • Loading branch information
Shnoulle committed Oct 1, 2014
1 parent 5e325eb commit 3a11253
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -515,6 +515,7 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)

//BEGIN: GATHER INFORMATION
// 1: Get information for this question
// @todo : use viewHelper::getFieldText and getFieldCode for 2.06 for string show to user
if (!isset($qid)) { $qid = returnGlobal('qid'); }
if (!isset($iSurveyID)) { $iSurveyID = returnGlobal('sid'); }
$thissurvey = getSurveyInfo($iSurveyID);
Expand Down Expand Up @@ -814,8 +815,10 @@ function index($subaction, $iSurveyID=null, $gid=null, $qid=null)
foreach ($aresult as $arows)
{
$attr = getQuestionAttributeValues($rows['qid']);
$label1 = isset($attr['dualscale_headerA']) ? $attr['dualscale_headerA'] : 'Label1';
$label2 = isset($attr['dualscale_headerB']) ? $attr['dualscale_headerB'] : 'Label2';
$sLanguage=Survey::model()->findByPk($iSurveyID)->language;
// dualscale_header are allways set, but can be empty
$label1 = empty($attr['dualscale_headerA'][$sLanguage]) ? gt('Scale 1') : $attr['dualscale_headerA'][$sLanguage];
$label2 = empty($attr['dualscale_headerB'][$sLanguage]) ? gt('Scale 2') : $attr['dualscale_headerB'][$sLanguage];
$shortanswer = "{$arows['title']}: [" . strip_tags($arows['question']) . "][$label1]";
$shortquestion = $rows['title'].":$shortanswer ".strip_tags($rows['question']);
$cquestions[] = array($shortquestion, $rows['qid'], $rows['type'], $rows['sid'].$X.$rows['gid'].$X.$rows['qid'].$arows['title']."#0");
Expand Down

0 comments on commit 3a11253

Please sign in to comment.