MDL-62798 repositories: Report sections by name in server repository
authorMihail Geshoski <mihail@moodle.com>
Mon, 2 Jul 2018 06:54:25 +0000 (14:54 +0800)
committerMihail Geshoski <mihail@moodle.com>
Mon, 6 Aug 2018 01:55:35 +0000 (09:55 +0800)
lib/filebrowser/file_info_context_course.php

index 7afca6c..4c8b797 100644 (file)
@@ -229,7 +229,9 @@ class file_info_context_course extends file_info {
             }
         }
         $urlbase = $CFG->wwwroot.'/pluginfile.php';
-        return new file_info_stored($this->browser, $this->context, $storedfile, $urlbase, $section->section, true, true, true, false);
+        require_once($CFG->dirroot.'/course/lib.php');
+        $sectionname = get_section_name($this->course, $section);
+        return new file_info_stored($this->browser, $this->context, $storedfile, $urlbase, $sectionname, true, true, true, false);
     }
 
     /**