mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
4868e95f58
print_courses() produced PHP notice (Trying to get property of non-object) and generated an invalid button to create a new course in this case: (1) Passed paramater $category is 0 to display all categores (as in case of home page, for example) and (2) get_child_categories(0) returns more than one record. In such case, $categories is still a plain integer, does not contain ->id property and the called /course/edit.php exits with error. This patch uses $CFG->defaultrequestcategory as category id in this case.