Skip to content

Commit

Permalink
Fixed issue #13590: Check data integrity shows 'errorneous question g…
Browse files Browse the repository at this point in the history
…roup order' for all surveys
  • Loading branch information
olleharstedt committed Apr 24, 2018
1 parent c58f790 commit f71bb07
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions application/controllers/admin/checkintegrity.php
Expand Up @@ -861,11 +861,12 @@ protected function checkGroupOrderDuplicates()
{
$sQuery = "
SELECT
sid
FROM
{{groups}}
GROUP BY sid
HAVING COUNT(DISTINCT group_order) != COUNT(gid)";
g.sid
FROM {{groups}} g
JOIN {{surveys}} s ON s.sid = g.sid
WHERE g.language = s.language
GROUP BY g.sid
HAVING COUNT(DISTINCT g.group_order) != COUNT(g.gid)";
$result = Yii::app()->db->createCommand($sQuery)->queryAll();
if (!empty($result)) {
foreach ($result as &$survey) {
Expand Down Expand Up @@ -894,6 +895,8 @@ protected function checkQuestionOrderDuplicates()
q.parent_qid
FROM {{questions}} q
JOIN {{groups}} g ON q.gid = g.gid
JOIN {{surveys}} s ON s.sid = q.sid
WHERE q.language = s.language AND g.language = s.language
GROUP BY q.sid, q.gid, q.parent_qid
HAVING COUNT(DISTINCT question_order) != COUNT(qid);
";
Expand Down

0 comments on commit f71bb07

Please sign in to comment.