From 8e2d137725ddcc1a160afe78b1960411e018f927 Mon Sep 17 00:00:00 2001 From: Michael Milette Date: Fri, 4 Oct 2024 11:42:17 -0400 Subject: [PATCH] Fixed minor issue using {coursesummary} tag in a block. --- CHANGELOG.md | 3 ++- classes/text_filter.php | 9 ++++++++- version.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0937386..081f227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Change Log All notable changes to this project will be documented in this file. -## [2.5.2] 2024-09-03 (dev) +## [2.5.2] 2024-10-04 (rc) ### Added - New {menulanguages} tag. - New {keyboard}...{/keyboard} tag. @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - New {ifnotgrouping groupingid}...{/ifnotgrouping} tag. - New {mygroupings} tag. ### Updated +- Fixed issue when {coursesummary} is used in a block. - Link to External LTI now only available in Moodle 4.3+. - Addressed compatibility issue with mod_hvp that prevents link to current theme settings from working. - Refactoring in preparations for Moodle 4.5. diff --git a/classes/text_filter.php b/classes/text_filter.php index 91dce31..bc361dc 100644 --- a/classes/text_filter.php +++ b/classes/text_filter.php @@ -1161,8 +1161,15 @@ private function generatortags(&$text) { // No course ID specified. $coursecontext = \context_course::instance($PAGE->course->id); $PAGE->course->summary == null ? '' : $PAGE->course->summary; - $replace['/\{coursesummary\}/i'] = format_text( + $summary = file_rewrite_pluginfile_urls( $PAGE->course->summary, + 'pluginfile.php', + $coursecontext->id, + 'course', + 'section', + 0); + $replace['/\{coursesummary\}/i'] = format_text( + $summary, FORMAT_HTML, ['context' => $coursecontext] ); diff --git a/version.php b/version.php index c1b08f0..a66e096 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024082300; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2024100400; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2014051200; // Requires Moodle version 2.7 or later. $plugin->component = 'filter_filtercodes'; // Full name of the plugin (used for diagnostics). $plugin->release = '2.5.2';