From 9fe9652c1667f172bed6c4a0744eef668c94d23a Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 13 Nov 2024 10:23:25 +0800 Subject: [PATCH] MDL-83704 core: Stop loading subplugins files to uninstall The list of subplugin types was loaded from the json/php subplugins file, but then the actual list of subplugins was loaded from the cache in the component, rendering any benefit of using the source json/php as pointless. --- lib/adminlib.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/adminlib.php b/lib/adminlib.php index fb51e34ea3c..426d7046f2c 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -139,17 +139,7 @@ function uninstall_plugin($type, $name) { $subplugintypes = core_component::get_plugin_types_with_subplugins(); if (isset($subplugintypes[$type])) { $base = core_component::get_plugin_directory($type, $name); - - $subpluginsfile = "{$base}/db/subplugins.json"; - if (file_exists($subpluginsfile)) { - $subplugins = (array) json_decode(file_get_contents($subpluginsfile))->plugintypes; - } else if (file_exists("{$base}/db/subplugins.php")) { - debugging('Use of subplugins.php has been deprecated. ' . - 'Please update your plugin to provide a subplugins.json file instead.', - DEBUG_DEVELOPER); - $subplugins = []; - include("{$base}/db/subplugins.php"); - } + $subplugins = \core\component::get_subplugins("{$type}_{$name}"); if (!empty($subplugins)) { foreach (array_keys($subplugins) as $subplugintype) {