From f5a726feb3d3182267d9a9e8b18c73bd2d0d294c Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Fri, 25 Dec 2009 23:31:59 +0000 Subject: [PATCH] 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. --- lib/grade/grade_item.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5