mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
Merge branch 'master-48421' of https://github.com/timpricecatalyst/moodle
This commit is contained in:
commit
38da9a45e8
@ -1630,13 +1630,17 @@ class global_navigation extends navigation_node {
|
||||
} else if (array_key_exists($categoryid, $this->addedcategories)) {
|
||||
// The category itself has been loaded already so we just need to ensure its subcategories
|
||||
// have been loaded
|
||||
list($sql, $params) = $DB->get_in_or_equal(array_keys($this->addedcategories), SQL_PARAMS_NAMED, 'parent', false);
|
||||
if ($showbasecategories) {
|
||||
// We need to include categories with parent = 0 as well
|
||||
$sqlwhere .= " AND (cc.parent = :categoryid OR cc.parent = 0) AND cc.parent {$sql}";
|
||||
} else {
|
||||
// All we need is categories that match the parent
|
||||
$sqlwhere .= " AND cc.parent = :categoryid AND cc.parent {$sql}";
|
||||
$addedcategories = $this->addedcategories;
|
||||
unset($addedcategories[$categoryid]);
|
||||
if (count($addedcategories) > 0) {
|
||||
list($sql, $params) = $DB->get_in_or_equal(array_keys($addedcategories), SQL_PARAMS_NAMED, 'parent', false);
|
||||
if ($showbasecategories) {
|
||||
// We need to include categories with parent = 0 as well
|
||||
$sqlwhere .= " AND (cc.parent = :categoryid OR cc.parent = 0) AND cc.parent {$sql}";
|
||||
} else {
|
||||
// All we need is categories that match the parent
|
||||
$sqlwhere .= " AND cc.parent = :categoryid AND cc.parent {$sql}";
|
||||
}
|
||||
}
|
||||
$params['categoryid'] = $categoryid;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user