Skip to content

Commit

Permalink
Fixed issue #7852: Cryptic error when survey is deactivated twice
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Jun 14, 2013
1 parent 928e31d commit a3d2eb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -314,6 +314,11 @@ public function deactivate($iSurveyID = null)
$iSurveyID = Yii::app()->request->getPost('sid', $iSurveyID);
$iSurveyID = sanitize_int($iSurveyID);
$clang = $this->getController()->lang;
if (!tableExists('survey_'.$iSurveyID))
{
$_SESSION['flashmessage'] = $clang->gT("Error: Response table does not exist. Survey cannot be deactivated.");
$this->getController()->redirect($this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}"));
}
$date = date('YmdHis'); //'His' adds 24hours+minutes to name to allow multiple deactiviations in a day

if (empty($_POST['ok']))
Expand Down

0 comments on commit a3d2eb9

Please sign in to comment.