MDL-42609 course: management default missing bits

With the previous commit in this issue, now the course management
UI defaults to show the "default category" courses.

But some bits were missing in order to make that default behavior
fully equivalent with the manual navigation to that category.

This patch:
  - Adds the missing categoryid url param, used by some of the options
    in the UI, like sorting, that was completely broken.
  - Sets the context to the default category, previously was being set to
    system context, incorrectly if now we are defaulting to a category.

That way everything is 100% the same than when we land to the category manually.
This commit is contained in:
Eloy Lafuente (stronk7) 2014-07-08 21:07:56 +02:00
parent 4c8914b777
commit fa4f0de6b1

View file

@ -71,7 +71,8 @@ if ($courseid) {
$courseid = null; $courseid = null;
$category = coursecat::get_default(); $category = coursecat::get_default();
$categoryid = $category->id; $categoryid = $category->id;
$context = $systemcontext; $context = context_coursecat::instance($category->id);
$url->param('categoryid', $category->id);
} }
// Check if there is a selected category param, and if there is apply it. // Check if there is a selected category param, and if there is apply it.