From 69e10928990422e5c4ce3b849b6ed40024b2d168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jessica=20H=C3=B6ck?= Date: Mon, 9 Mar 2020 16:18:35 +0100 Subject: [PATCH] Fixed missing postgres aliases --- .../controllers/admin/conditionsaction.php | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/application/controllers/admin/conditionsaction.php b/application/controllers/admin/conditionsaction.php index 70b650c36e5..f6b4e5a6e97 100644 --- a/application/controllers/admin/conditionsaction.php +++ b/application/controllers/admin/conditionsaction.php @@ -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) @@ -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; @@ -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)); @@ -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'], @@ -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'],