]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13117 - course info was unavailable to students. There was broken logic...
authorpoltawski <poltawski>
Fri, 25 Jan 2008 20:46:36 +0000 (20:46 +0000)
committerpoltawski <poltawski>
Fri, 25 Jan 2008 20:46:36 +0000 (20:46 +0000)
course_parent_visible() always returns true if $CFG->allowvisiblecoursesinhiddencategories
is true,

course/info.php

index 27354c9eef4df8b6f62881ea25eaa8d10e5636e6..e5ecf3304f033ef73d3f7c000241f01e9608bb52 100644 (file)
@@ -29,7 +29,7 @@
     }
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
-    if ((!(course_parent_visible($course) && $CFG->allowvisiblecoursesinhiddencategories) || (! $course->visible)) && !has_capability('moodle/course:viewhiddencourses', $context)) {
+    if ((!course_parent_visible($course) || (! $course->visible)) && !has_capability('moodle/course:viewhiddencourses', $context)) {
         error(get_string('coursehidden'), $CFG->wwwroot .'/'); 
     }