From fbb5eaf542744f1e9745fcb5a31c6f851a678629 Mon Sep 17 00:00:00 2001 From: Menno Dekker Date: Thu, 22 Nov 2012 10:57:26 +0100 Subject: [PATCH] Fixed #6920: CDbException when checking data integrity --- application/controllers/admin/checkintegrity.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/admin/checkintegrity.php b/application/controllers/admin/checkintegrity.php index 015cf460fd2..e77ee41386c 100644 --- a/application/controllers/admin/checkintegrity.php +++ b/application/controllers/admin/checkintegrity.php @@ -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']})"); } @@ -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'));