From be007459d3b63646cc020ae2769bde14aa17d726 Mon Sep 17 00:00:00 2001 From: David Woloszyn Date: Tue, 8 Apr 2025 16:02:22 +1000 Subject: [PATCH] MDL-84351 tool_mfa: Fix guidance page file access File uploaded to the guidance page were not accessible due to null values being provided to $course and $cm params for the tool_mfa_pluginfile. --- admin/tool/mfa/lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/tool/mfa/lib.php b/admin/tool/mfa/lib.php index 111a38c796a..fc52612088e 100644 --- a/admin/tool/mfa/lib.php +++ b/admin/tool/mfa/lib.php @@ -126,8 +126,8 @@ function tool_mfa_bulk_user_actions(): array { /** * Serves any files for the guidance page. * - * @param stdClass $course - * @param stdClass $cm + * @param stdClass|null $course + * @param stdClass|null $cm * @param context $context * @param string $filearea * @param array $args @@ -135,7 +135,7 @@ function tool_mfa_bulk_user_actions(): array { * @param array $options * @return bool */ -function tool_mfa_pluginfile(stdClass $course, stdClass $cm, context $context, string $filearea, +function tool_mfa_pluginfile(stdClass|null $course, stdClass|null $cm, context $context, string $filearea, array $args, bool $forcedownload, array $options = []): bool { // Hardcode to only send guidance files from the top level. $fs = get_file_storage();