MDL-24927 fixed orphaned activities regression when single topic selected
authorPetr Skoda <skodak@moodle.org>
Fri, 29 Oct 2010 20:01:21 +0000 (20:01 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 29 Oct 2010 20:01:21 +0000 (20:01 +0000)
course/format/topics/format.php
course/format/weeks/format.php

index 048b76a..564e3e9 100644 (file)
@@ -255,7 +255,7 @@ while ($section <= $course->numsections) {
     $section++;
 }
 
-if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
+if (!$displaysection and $PAGE->user_is_editing() and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
     // print stealth sections if present
     $modinfo = get_fast_modinfo($course);
     foreach ($sections as $section=>$thissection) {
index ab1d466..5aa0c2f 100644 (file)
@@ -256,7 +256,7 @@ defined('MOODLE_INTERNAL') || die();
         $weekdate = $nextweekdate;
     }
 
-    if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
+    if (!$displaysection and $PAGE->user_is_editing() and has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) {
         // print stealth sections if present
         $modinfo = get_fast_modinfo($course);
         foreach ($sections as $section=>$thissection) {