MDL-34444 course: show section availability info
authorDan Poltawski <dan@moodle.com>
Wed, 1 Aug 2012 02:28:36 +0000 (10:28 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 1 Aug 2012 02:31:16 +0000 (10:31 +0800)
When available, rather than a capability error.

course/view.php

index ad495dd..028a3f4 100644 (file)
         $coursesections = $modinfo->get_section_info($section, MUST_EXIST);
 
         // Check user is allowed to see it.
-        if (!$coursesections->uservisible) {
+        if (!$coursesections->uservisible && !empty($section->availableinfo)) {
             // Note: We actually already know they don't have this capability
             // or uservisible would have been true; this is just to get the
             // correct error message shown.