Skip to content

Commit

Permalink
Dev Integrity check now checks for activated surveys without response…
Browse files Browse the repository at this point in the history
… table
  • Loading branch information
c-schmitz committed Oct 19, 2012
1 parent 71f8ad4 commit 097335c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions application/controllers/admin/checkintegrity.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,19 @@ protected function _checkintegrity()
$criteria->addNotInCondition('sid', $sids, 'OR');

Survey_permissions::model()->deleteAll($criteria);


// Deactivate surveys that have a missing response table
foreach ($surveys as $survey)
{
if ($survey['active']=='Y' && !tableExists("{{survey_{$survey['sid']}}}"))
{
Survey::model()->updateByPk($survey['sid'],array('active'=>'N'));
}
}



// Fix subquestions
fixSubquestions();

Expand Down

0 comments on commit 097335c

Please sign in to comment.