]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21190 Re-fixing a regression in dependency calculation
authorDavid Mudrak <david.mudrak@gmail.com>
Fri, 25 Dec 2009 17:18:52 +0000 (17:18 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Fri, 25 Dec 2009 17:18:52 +0000 (17:18 +0000)
Sorry for the last commit. This should be the proper way. The problem
was with the question mark within quotes - it was not considered as a
placeholder.

lib/grade/grade_item.php

index d0989b7cba166e80662785f0fd79cb1c2fba9c25..5c2be297f904fbac84a0db0788a7a0df52cfd4d2 100644 (file)
@@ -1331,7 +1331,7 @@ class grade_item extends grade_object {
 
             if ($grade_category->aggregatesubcats) {
                 // return all children excluding category items
-                $params[] = $grade_category->id;
+                $params[] = '%/' . $grade_category->id . '/%';
                 $sql = "SELECT gi.id
                           FROM {grade_items} gi
                          WHERE $gtypes
@@ -1339,8 +1339,7 @@ class grade_item extends grade_object {
                                AND gi.categoryid IN (
                                   SELECT gc.id
                                     FROM {grade_categories} gc
-                                   WHERE gc.path LIKE '%/?/%')";
-
+                                   WHERE gc.path LIKE ?)";
             } else {
                 $params[] = $grade_category->id;
                 $params[] = $grade_category->id;