Skip to content

Commit

Permalink
Fixed issue: Accidental double deactivation throws database error
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Sep 22, 2020
1 parent dec1f30 commit a58ef3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/controllers/admin/surveyadmin.php
Expand Up @@ -742,11 +742,11 @@ public function deactivate($iSurveyID = null)
return;
}

if (!tableExists('survey_'.$iSurveyID)) {
$_SESSION['flashmessage'] = gT("Error: Response table does not exist. Survey cannot be deactivated.");
$this->getController()->redirect($this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}"));
}
if (Yii::app()->request->getPost('ok') == '') {
if (!tableExists('survey_'.$iSurveyID)) {
$_SESSION['flashmessage'] = gT("Error: Response table does not exist. Survey cannot be deactivated.");
$this->getController()->redirect($this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}"));
}
$aData['surveyid'] = $iSurveyID;
$aData['date'] = $date;
$aData['dbprefix'] = Yii::app()->db->tablePrefix;
Expand Down

0 comments on commit a58ef3a

Please sign in to comment.