Permalink
Browse files

MDL-27597 fix invalid results of get_categories when shallow is false

  • Loading branch information...
1 parent 51793f4 commit 3adf4006a7c537fdcd323d64075c72398dd77d3d @skodak skodak committed Aug 5, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
@@ -1238,7 +1238,7 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
JOIN {$CFG->prefix}context ctx
ON cc.id=ctx.instanceid AND ctx.contextlevel=".CONTEXT_COURSECAT."
JOIN {$CFG->prefix}course_categories ccp
- ON (cc.path LIKE ".sql_concat('ccp.path',"'%'").")
+ ON ((cc.parent=ccp.id) OR (cc.path LIKE ".sql_concat('ccp.path',"'/%'")."))
WHERE ccp.id=$parent
$sort";
}

0 comments on commit 3adf400

Please sign in to comment.