From 26c42bf02dccd51048732d2b1db7224de03fc00f Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 19 Jul 2024 13:43:13 +0100 Subject: [PATCH] MDL-58287 courseformat: ensure all format plugins are returned. --- course/lib.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/course/lib.php b/course/lib.php index 3eca82d2fa2..d2c6222052d 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2982,7 +2982,8 @@ function include_course_editor(course_format $format) { */ function get_sorted_course_formats($enabledonly = false) { global $CFG; - $formats = core_component::get_plugin_list('format'); + + $formats = core_plugin_manager::instance()->get_installed_plugins('format'); if (!empty($CFG->format_plugins_sortorder)) { $order = explode(',', $CFG->format_plugins_sortorder); @@ -2996,7 +2997,9 @@ function get_sorted_course_formats($enabledonly = false) { } $sortedformats = array(); foreach ($order as $formatname) { - if (!get_config('format_'.$formatname, 'disabled')) { + $component = "format_{$formatname}"; + $componentdir = core_component::get_component_directory($component); + if ($componentdir !== null && !get_config($component, 'disabled')) { $sortedformats[] = $formatname; } }