MDL-34444 course: show section availability info

When available, rather than a capability error.
This commit is contained in:
Dan Poltawski
2012-08-01 10:31:16 +08:00
parent b44ae5fb0a
commit 87a31bb5d8
+1 -1
View File
@@ -105,7 +105,7 @@
$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.