diff --git a/application/controllers/admin/questions.php b/application/controllers/admin/questions.php index e269f37f887..612c36d2f86 100644 --- a/application/controllers/admin/questions.php +++ b/application/controllers/admin/questions.php @@ -1116,7 +1116,7 @@ public function delete($surveyid=null, $qid=null, $gid = 0, $massAction = false) ]; } - $redirect = Yii::app()->createUrl('admin/survey/sa/listquestions/', ['surveyid' => $surveyid, 'gid' => $gid_search]); + $redirect = Yii::app()->createUrl('admin/survey/sa/listquestions/', ['surveyid' => $surveyid]); if (Yii::app()->request->isAjaxRequest) { $this->renderJSON( [ diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 9e53d60d7af..82407a41a23 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -677,7 +677,7 @@ private function setArgs() if ($this->aSurveyInfo['refurl'] == "Y") { //Only add this if it doesn't already exist - if (!in_array("refurl", $_SESSION[$this->LEMsessid]['insertarray'])) { + if ($this->LEMsessid && !in_array("refurl", $_SESSION[$this->LEMsessid]['insertarray'])) { $_SESSION[$this->LEMsessid]['insertarray'][] = "refurl"; } } @@ -1398,6 +1398,7 @@ private function setVarFromArgs($args) $this->LEMskipReprocessing = isset($LEMskipReprocessing) ? $LEMskipReprocessing : null; $this->thissurvey = isset($thissurvey) ? $thissurvey : null; $this->iSurveyid = isset($surveyid) ? $surveyid : null; + $this->LEMsessid = $this->iSurveyid ? 'survey_'.$this->iSurveyid: null; $this->aSurveyOptions = isset($surveyOptions) ? $surveyOptions : null; $this->aMoveResult = isset($moveResult) ? $moveResult : null; $this->sMove = isset($move) ? $move : null; @@ -1695,18 +1696,18 @@ private function makeLanguageChanger() * This method will set survey values in public property of the class * So, any value here set as $this->xxx will be available as $xxx after : * eg: $this->LEMsessid - * + * @param integer $surveyid; + * @param array $args; */ private function setSurveySettings($surveyid, $args) { - $this->setVarFromArgs($args); // Set the private variable from $args + $this->setVarFromArgs(array_merge($args, array('surveyid' => $surveyid))); // Set the private variable from $args, be sure to set surveyid $this->initTemplate(); // Template settings $this->setJavascriptVar(); $this->setArgs(); extract($args); - $this->LEMsessid = 'survey_'.$this->iSurveyid; $this->aSurveyInfo = getSurveyInfo($this->iSurveyid, App()->getLanguage()); $this->aSurveyInfo['surveyUrl'] = App()->createUrl("/survey/index", array("sid"=>$this->iSurveyid));