MDL-40423 fix creation of new install.xml in subplugins

This commit is contained in:
Petr Škoda
2013-07-16 21:56:40 +02:00
committed by Eloy Lafuente (stronk7)
parent 4474895d37
commit 405d2962d2
@@ -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;