MDL-58833 tool_templatelibrary: Skip if directory empty
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 8 May 2017 07:01:52 +0000 (15:01 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 8 May 2017 07:01:52 +0000 (15:01 +0800)
admin/tool/templatelibrary/classes/api.php

index b760007..7ae2b0e 100644 (file)
@@ -70,6 +70,9 @@ class api {
             // Look at all the templates dirs for subsystems.
             $subsystems = core_component::get_core_subsystems();
             foreach ($subsystems as $subsystem => $dir) {
+                if (empty($dir)) {
+                    continue;
+                }
                 $dir .= '/templates';
                 if (is_dir($dir)) {
                     $dirs = mustache_template_finder::get_template_directories_for_component('core_' . $subsystem, $themename);