Skip to content

Commit

Permalink
Fixed issue: Dataset after query was still open creating problems on …
Browse files Browse the repository at this point in the history
…previewing a survey
  • Loading branch information
c-schmitz committed Jan 13, 2013
1 parent 05c9855 commit 65ec1d5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions application/helpers/frontend_helper.php
Expand Up @@ -2271,10 +2271,11 @@ function UpdateGroupList($surveyid, $language)
}
}

/**
* FieldArray contains all necessary information regarding the questions
* This function is needed to update it in case the survey is switched to another language
*/
function UpdateFieldArray()
//The FieldArray contains all necessary information regarding the questions
//This function is needed to update it in case the survey is switched to another language

{
global $surveyid;

Expand All @@ -2287,15 +2288,14 @@ function UpdateFieldArray()
{
$questionarray =& $_SESSION['survey_'.$surveyid]['fieldarray'][$key];

$query = "SELECT * FROM {{questions}} WHERE qid=".$questionarray[0]." AND language='".$_SESSION['survey_'.$surveyid]['s_lang']."'";
$result = dbExecuteAssoc($query) or safeDie ("Couldn't get question <br />$query<br />"); //Checked
$row = $result->read();
$questionarray[2]=$row['title'];
$questionarray[3]=$row['question'];
$query = "SELECT title, question FROM {{questions}} WHERE qid=".$questionarray[0]." AND language='".$_SESSION['survey_'.$surveyid]['s_lang']."'";
$usrow = Yii::app()->db->createCommand($query)->queryRow();
if (!$usrow) safeDie ("Couldn't get question <br />$query<br />"); //Checked
$questionarray[2]=$usrow['title'];
$questionarray[3]=$usrow['question'];
unset($questionarray);
}
}

}

/**
Expand Down

0 comments on commit 65ec1d5

Please sign in to comment.