mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-69704 course: catch exception when calling get_course_content_items
When plugins are removed from disk, an exception is thrown when calling component_callback_exists. This exception should be catched here in order to load properly the activity chooser (otherwise, the exception will be displayed and no activity will appear).
This commit is contained in:
parent
e049d30613
commit
64fbd346ba
@ -138,8 +138,12 @@ class content_item_service {
|
||||
// Add any subplugins to the list of item types.
|
||||
$subplugins = $pluginmanager->get_subplugins_of_plugin('mod_' . $plugin->name);
|
||||
foreach ($subplugins as $subpluginname => $subplugininfo) {
|
||||
if (component_callback_exists($subpluginname, 'get_course_content_items')) {
|
||||
$itemtypes[] = $prefix . $subpluginname;
|
||||
try {
|
||||
if (component_callback_exists($subpluginname, 'get_course_content_items')) {
|
||||
$itemtypes[] = $prefix . $subpluginname;
|
||||
}
|
||||
} catch (\moodle_exception $e) {
|
||||
debugging('Cannot get_course_content_items: ' . $e->getMessage(), DEBUG_DEVELOPER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user