MDL-33066 navigation: Fixed ambiguously defined columns in DB queries for Oracle

This commit is contained in:
Sam Hemelryk 2012-05-18 10:37:44 +12:00
parent 71d7bc34a8
commit 957983b702

View File

@ -1701,7 +1701,7 @@ class global_navigation extends navigation_node {
FROM {course_categories} cc
JOIN {context} ctx ON cc.id = ctx.instanceid";
$sqlwhere = "WHERE ctx.contextlevel = ".CONTEXT_COURSECAT;
$sqlorder = "ORDER BY depth ASC, sortorder ASC, id ASC";
$sqlorder = "ORDER BY cc.depth ASC, cc.sortorder ASC, cc.id ASC";
$params = array();
$categoriestoload = array();
@ -2912,7 +2912,7 @@ class global_navigation_for_ajax extends global_navigation {
JOIN {context} ctx ON cc.id = ctx.instanceid
WHERE ctx.contextlevel = ".CONTEXT_COURSECAT." AND
(cc.id = :categoryid1 OR cc.parent = :categoryid2)
ORDER BY depth ASC, sortorder ASC, id ASC";
ORDER BY cc.depth ASC, cc.sortorder ASC, cc.id ASC";
$params = array('categoryid1' => $categoryid, 'categoryid2' => $categoryid);
$categories = $DB->get_recordset_sql($sql, $params, 0, $limit);
$subcategories = array();