MDL-34539 course - allow negative section numbers
authorDan Poltawski <dan@moodle.com>
Tue, 14 Aug 2012 03:33:32 +0000 (11:33 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 14 Aug 2012 03:34:19 +0000 (11:34 +0800)
This gives course format authors more flexibility.

Thanks to Itamar Tzadok for the suggestion.

course/view.php

index c750205..cb978d8 100644 (file)
@@ -97,7 +97,7 @@
     $logparam = 'id='. $course->id;
     $loglabel = 'view';
     $infoid = $course->id;
-    if(!empty($section)) {
+    if ($section and $section > 0) {
         $loglabel = 'view section';
 
         // Get section details and check it exists.