Skip to content

Commit

Permalink
Fixed issue #7071: Survey timing tables are archived and offered for …
Browse files Browse the repository at this point in the history
…deletion when visiting the integrity check
  • Loading branch information
c-schmitz committed Dec 19, 2012
1 parent 7eaae9d commit 227acbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/controllers/admin/checkintegrity.php
Expand Up @@ -361,7 +361,7 @@ protected function _checkintegrity()
if ($sTableName == 'survey_permissions' || $sTableName == 'survey_links' || $sTableName == 'survey_url_parameters') continue;
$aTableName=explode('_',$sTableName);
$iSurveyID = $aTableName[1];
if (false == array_search($iSurveyID, $sids)) {
if (!in_array($iSurveyID, $sids)) {
$sDate = date('YmdHis') . rand(1, 1000);
$sOldTable = "survey_{$iSurveyID}";
$sNewTable = "old_survey_{$iSurveyID}_{$sDate}";
Expand All @@ -379,7 +379,7 @@ protected function _checkintegrity()
{
$sTableName = substr(reset($aRow), strlen($sDBPrefix));
$iSurveyID = substr($sTableName, strpos($sTableName, '_') + 1);
if (false == array_search($iSurveyID, $sids)) {
if (!in_array($iSurveyID, $sids)) {
$sDate = date('YmdHis') . rand(1, 1000);
$sOldTable = "tokens_{$iSurveyID}";
$sNewTable = "old_tokens_{$iSurveyID}_{$sDate}";
Expand Down Expand Up @@ -591,11 +591,11 @@ protected function _checkintegrity()
foreach ($questions as $question)
{
//Make sure the group exists
if (false === array_search($question['gid'], $gids)) {
if (!in_array($question['gid'], $gids)) {
$aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => $clang->gT('No matching group') . " ({$question['gid']})");
}
//Make sure survey exists
if (false === array_search($question['sid'], $sids)) {
if (!in_array($question['sid'], $sids)) {
$aDelete['questions'][] = array('qid' => $question['qid'], 'reason' => $clang->gT('There is no matching survey.') . " ({$question['sid']})");
}
}
Expand Down

0 comments on commit 227acbb

Please sign in to comment.