diff --git a/course/classes/local/service/content_item_service.php b/course/classes/local/service/content_item_service.php index 20209ae2d9218..ca60efbc146f1 100644 --- a/course/classes/local/service/content_item_service.php +++ b/course/classes/local/service/content_item_service.php @@ -138,8 +138,12 @@ private function get_content_favourites(string $prefix, \context_user $userconte // 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); } } }