Merge branch 'MDL-65019-master' of git://github.com/jleyva/moodle
authorAdrian Greeve <abgreeve@gmail.com>
Fri, 5 Apr 2019 01:14:23 +0000 (09:14 +0800)
committerAdrian Greeve <abgreeve@gmail.com>
Fri, 5 Apr 2019 01:15:18 +0000 (09:15 +0800)
1  2 
course/externallib.php
course/tests/externallib_test.php

@@@ -326,6 -326,10 +326,11 @@@ class core_course_external extends exte
                                      'mimetypes' => array(),
                                  );
                                  foreach ($contents as $content) {
 -                                        $module['contentsinfo']['repositorytype'] = isset($content['repositorytype']) ? $content['repositorytype'] : '';
+                                     // Check repository file (only main file).
+                                     if (!isset($module['contentsinfo']['repositorytype'])) {
++                                          $module['contentsinfo']['repositorytype'] =
++                                                  isset($content['repositorytype']) ? $content['repositorytype'] : '';
+                                     }
                                      if (isset($content['filesize'])) {
                                          $module['contentsinfo']['filessize'] += $content['filesize'];
                                      }
Simple merge