MDL-84140 course: more resilient check for activity footer component.

This commit is contained in:
Paul Holden 2025-01-09 15:34:03 +00:00
parent 89d76fdc25
commit 90e06e0851
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164

View File

@ -4652,9 +4652,17 @@ class core_course_external extends external_api {
$coursecontext = context_course::instance($courseid);
self::validate_context($coursecontext);
$activeplugin = get_config('core', 'activitychooseractivefooter');
// The active plugin must be set, and be present on the site.
$activeplugin = clean_param(
get_config('core', 'activitychooseractivefooter'),
PARAM_COMPONENT,
);
if ($activeplugin !== COURSE_CHOOSER_FOOTER_NONE) {
if (
$activeplugin !== COURSE_CHOOSER_FOOTER_NONE &&
!empty($activeplugin) &&
core_component::get_component_directory($activeplugin) !== null
) {
$footerdata = component_callback($activeplugin, 'custom_chooser_footer', [$courseid, $sectionid]);
return [
'footer' => true,