diff --git a/config-dist.php b/config-dist.php index fad1e5ec62e..c34ef3c281f 100644 --- a/config-dist.php +++ b/config-dist.php @@ -281,6 +281,9 @@ $CFG->admin = 'admin'; // // $CFG->emailconnectionerrorsto = 'your@emailaddress.com'; // +// Restore pre-1.6 behaviour where courses could still be available +// even if the category they were in was hidden +// $CFG->allowvisiblecoursesinhiddencategories = true; // // NOTE: if you are using custompix in your theme, see /fixpix.php. diff --git a/lib/datalib.php b/lib/datalib.php index a8f1012a5ad..264e278ed25 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -3111,6 +3111,12 @@ function check_db_compat() { } function course_parent_visible($course = null) { + if (empty($course)) { + return true; + } + if (!empty($CFG->allowvisiblecoursesinhiddencategories)) { + return true; + } return category_parent_visible($course->category); }