Skip to content

Commit

Permalink
Fixed missing postgres aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessica Höck committed Mar 9, 2020
1 parent 8e46ca8 commit 69e1092
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions application/controllers/admin/conditionsaction.php
Expand Up @@ -88,10 +88,13 @@ public function __construct($controller = null, $id = null)
}

/**
* @param string $subaction
* @param int $iSurveyID
* @param int $gid
* @param int $qid
* Main Entry Method.
*
* @param string $subaction Given Subaction
* @param int $iSurveyID Given Survey ID
* @param int $gid Given Group ID
* @param int $qid Given Question ID
*
* @return void
*/
public function index($subaction, $iSurveyID = null, $gid = null, $qid = null)
Expand Down Expand Up @@ -136,9 +139,15 @@ public function index($subaction, $iSurveyID = null, $gid = null, $qid = null)
}

//BEGIN Sanitizing POSTed data
if (!isset($iSurveyID)) { $iSurveyID = returnGlobal('sid'); }
if (!isset($qid)) { $qid = returnGlobal('qid'); }
if (!isset($gid)) { $gid = returnGlobal('gid'); }
if (!isset($iSurveyID)) {
$iSurveyID = returnGlobal('sid');
}
if (!isset($qid)) {
$qid = returnGlobal('qid');
}
if (!isset($gid)) {
$gid = returnGlobal('gid');
}
$gid = (int) $gid;
$qid = (int) $qid;

Expand Down Expand Up @@ -1209,9 +1218,10 @@ protected function getTheseRows(array $questionlist)
$result = Question::model()->with(array(
'group' => array(
'condition' => 'questionGroupL10ns.language = :lang',
'params' => array(':lang' => $this->language)
'params' => array(':lang' => $this->language),
'alias' => 'group',
),
'group.questionGroupL10ns',
'group.questionGroupL10ns' => array('alias' =>'questiongroupl10ns' ),
'questionL10ns'
))->findAllByAttributes(array('qid' => $ql, 'parent_qid' => 0, 'sid' => $this->iSurveyID));

Expand Down Expand Up @@ -1391,8 +1401,9 @@ protected function getCAnswersAndCQuestions(array $theserows)
case "H":
$fresult = Answer::model()->with(array(
'answerL10ns' => array(
'condition' => 'answerL10ns.language = :lang',
'params' => array(':lang' => $this->language)
'condition' => 'answerl10ns.language = :lang',
'params' => array(':lang' => $this->language),
'alias' => 'answerl10ns',
)))->findAllByAttributes(
array(
'qid' => $rows['qid'],
Expand Down Expand Up @@ -1621,7 +1632,8 @@ protected function getCAnswersAndCQuestions(array $theserows)
$aresult = Answer::model()->with(array(
'answerL10ns' => array(
'condition' => 'answerL10ns.language = :lang',
'params' => array(':lang' => $this->language)
'params' => array(':lang' => $this->language),
'alias' => 'answerl10ns',
))
)->findAllByAttributes(array(
'qid' => $rows['qid'],
Expand Down

0 comments on commit 69e1092

Please sign in to comment.