Skip to content

Commit

Permalink
MDL-84140 course: more resilient check for activity footer component.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jan 9, 2025
1 parent a843eab commit 4e96885
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions course/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4596,9 +4596,17 @@ public static function get_activity_chooser_footer(int $courseid, int $sectionid
$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,
Expand Down

0 comments on commit 4e96885

Please sign in to comment.