From 405d2962d29e95f180d35a079030132f071c751b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sat, 6 Jul 2013 13:49:51 +0200 Subject: [PATCH] MDL-40423 fix creation of new install.xml in subplugins --- .../xmldb/actions/create_xml_file/create_xml_file.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php index 40a93da904a..06437a5e5d0 100644 --- a/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php +++ b/admin/tool/xmldb/actions/create_xml_file/create_xml_file.class.php @@ -118,7 +118,8 @@ class create_xml_file extends XMLDBAction { function get_plugin_type($dirpath) { global $CFG; $dirpath = $CFG->dirroot.$dirpath; - $plugintypes = get_plugin_types(); + // Reverse order so that we get subplugin matches. + $plugintypes = array_reverse(get_plugin_types()); foreach ($plugintypes as $plugintype => $pluginbasedir) { if (substr($dirpath, 0, strlen($pluginbasedir)) == $pluginbasedir) { return $plugintype;