diff --git a/application/controllers/survey/index.php b/application/controllers/survey/index.php index f7911d4d943..57eb4ba05e3 100644 --- a/application/controllers/survey/index.php +++ b/application/controllers/survey/index.php @@ -61,6 +61,10 @@ function action() $surveyExists = ($surveyid && Survey::model()->findByPk($surveyid)); $isSurveyActive = ($surveyExists && Survey::model()->findByPk($surveyid)->active=="Y"); + if($surveyExists){ + $oSurvey = Survey::model()->findByPk($surveyid); + } + // collect all data in this method to pass on later $redata = compact(array_keys(get_defined_vars())); @@ -262,7 +266,7 @@ function action() } //SEE IF SURVEY USES TOKENS - if ($surveyExists == 1 && $survey->hasTokensTable){ + if ($surveyExists == 1 && $oSurvey->hasTokensTable){ $tokensexist = 1; }else{ $tokensexist = 0;