From: David Mudrak Date: Fri, 25 Dec 2009 23:31:59 +0000 (+0000) Subject: MDL-21191 Fixing another regression in dependency calculation X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f5a726feb3d3182267d9a9e8b18c73bd2d0d294c;p=moodle.git MDL-21191 Fixing another regression in dependency calculation 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. --- diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index 5c2be297f9..1cd11dd856 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -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