Skip to content

Commit

Permalink
MDL-21191 Fixing another regression in dependency calculation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Dec 25, 2009
1 parent 84d6e83 commit f5a726f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/grade/grade_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1343,8 +1343,12 @@ public function depends_on($reset_cache=false) {
} 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
Expand Down

0 comments on commit f5a726f

Please sign in to comment.