Skip to content

Commit

Permalink
Fixed #6920: CDbException when checking data integrity
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Nov 22, 2012
1 parent 66a9994 commit fbb5eaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/controllers/admin/checkintegrity.php
Expand Up @@ -421,7 +421,7 @@ protected function _checkintegrity()
{
if (preg_match('/^\+{0,1}[0-9]+X[0-9]+X*$/', $condition['cfieldname'])) { // only if cfieldname isn't Tag such as {TOKEN:EMAIL} or any other token
list ($surveyid, $gid, $rest) = explode('X', $condition['cfieldname']);
$iRowCount = count(Groups::model()->findAllByPk($gid));
$iRowCount = count(Groups::model()->findAllByAttributes(array('gid'=>$gid)));
if (Groups::model()->hasErrors()) safeDie(Groups::model()->getError());
if (!$iRowCount) $aDelete['conditions'][] = array('cid' => $condition['cid'], 'reason' => $clang->gT('No matching CFIELDNAME group!') . " ($gid) ({$condition['cfieldname']})");
}
Expand Down Expand Up @@ -526,7 +526,7 @@ protected function _checkintegrity()
if (Assessment::model()->hasErrors()) safeDie(Assessment::model()->getError());
foreach ($assessments as $assessment)
{
$iAssessmentCount = count(Groups::model()->findAllByPk($assessment['gid']));
$iAssessmentCount = count(Groups::model()->findAllByPk(array('gid'=>$assessment['gid'], 'language'=>$assessment['language'])));
if (Groups::model()->hasErrors()) safeDie(Groups::model()->getError());
if (!$iAssessmentCount) {
$aDelete['assessments'][] = array('id' => $assessment['id'], 'assessment' => $assessment['name'], 'reason' => $clang->gT('No matching group'));
Expand Down

0 comments on commit fbb5eaf

Please sign in to comment.