Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 56eff9425280ff6a44cc04c3e5f3b421ed89c416 1 parent 4b85dc1
@skodak skodak authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.