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.
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
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;