]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21191 Fixing another regression in dependency calculation
authorDavid Mudrak <david.mudrak@gmail.com>
Fri, 25 Dec 2009 23:31:59 +0000 (23:31 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Fri, 25 Dec 2009 23:31:59 +0000 (23:31 +0000)
This is not easy to spot as $params may just contain one more item than $sql
would expect. However, $sql and $params should be well paired.

lib/grade/grade_item.php

index 5c2be297f904fbac84a0db0788a7a0df52cfd4d2..1cd11dd85615f85769c087ef39b79184fb6a11eb 100644 (file)
@@ -1343,8 +1343,12 @@ class grade_item extends grade_object {
             } else {
                 $params[] = $grade_category->id;
                 $params[] = $grade_category->id;
-                $params[] = GRADE_TYPE_VALUE;
-                $params[] = GRADE_TYPE_SCALE;
+                if (empty($CFG->grade_includescalesinaggregation)) {
+                    $params[] = GRADE_TYPE_VALUE;
+                } else {
+                    $params[] = GRADE_TYPE_VALUE;
+                    $params[] = GRADE_TYPE_SCALE;
+                }
                 $sql = "SELECT gi.id
                           FROM {grade_items} gi
                          WHERE $gtypes