Sub plugin types paths start with a / like plugin types
authorFrederic Massart <fred@moodle.com>
Fri, 9 May 2014 08:56:42 +0000 (16:56 +0800)
committerFrederic Massart <fred@moodle.com>
Fri, 9 May 2014 08:56:42 +0000 (16:56 +0800)
lib/plugins.py

index 26eefaf..fc384c8 100644 (file)
@@ -211,7 +211,7 @@ class PluginManager(object):
                         search = regex.findall(line)
                         if search:
                             for match in search:
-                                subtypes[match[1]] = match[2].replace('admin/', '{admin}/')
+                                subtypes[match[1]] = '/' + match[2].replace('admin/', '{admin}/').lstrip('/')
 
                     # Exit when we find a semi-colon.
                     if searchOpen and ';' in line: