Skip to content
Browse files

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

  • Loading branch information...
1 parent 4b85dc1 commit 56eff9425280ff6a44cc04c3e5f3b421ed89c416 @skodak skodak committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
2 lib/datalib.php
@@ -847,7 +847,7 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
FROM {course_categories} cc
$ccjoin
JOIN {course_categories} ccp
- ON (cc.path LIKE ".$DB->sql_concat('ccp.path',"'%'").")
+ ON ((cc.parent = ccp.id) OR (cc.path LIKE ".$DB->sql_concat('ccp.path',"'/%'")."))
WHERE ccp.id=?
$sort";
$params = array($parent);

0 comments on commit 56eff94

Please sign in to comment.
Something went wrong with that request. Please try again.