From 35a265fd55bfa65daad3cb17b3e585644dfa6e7a Mon Sep 17 00:00:00 2001 From: Rajan Dangi <42113582+rajandangi@users.noreply.github.com> Date: Tue, 3 Sep 2024 09:41:27 +0930 Subject: [PATCH] Fix mdl 404 errors (#46) * Fix: issue MDL-74778 * Replaced deprecated methods with new ones in mdl 404 * Fix: String [aria:courseimage,core_course] is deprecated * Update README * Fix formatting * Bump versions in version.php * fix : $plugin->supported args * Fix: $plugin->requires version * fix: space formatting * Removed: format_topics dependency in version.php * Updated README.md with minor cleanups. --- README.md | 7 ++++--- classes/output/courseformat/content.php | 4 ++-- format.php | 5 +---- templates/course_summary.mustache | 2 +- templates/course_summary_reverse.mustache | 2 +- templates/course_topic.mustache | 2 +- version.php | 10 ++++------ 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index d8b898b..6481377 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ This plugin currently supports Moodle: |--------------------|----------------------| | Moodle 3.8 to 3.10 | MOODLE_38_STABLE | | Moodle 3.11 | MOODLE_311_STABLE | -| Moodle 4.0+ | MOODLE_400_STABLE | +| Moodle 4.0 to 4.3 | MOODLE_400_STABLE | +| Moodle 4.4+ | MOODLE_404_STABLE | ## Installation @@ -66,7 +67,7 @@ You can choose from the course settings how the course and section images are di There are three options for formatting the display of the header image: * Contain: Scales the image as large as possible without cropping or stretching the image. * Contain Left: Sam as contain but the image is left aligned. -* Cover: Scales the image (while preserving its ratio) to the smallest possible size to fill, leaving no empty space. Image may be cropped. +* Cover: Scales the image (while preserving its ratio) to the smallest possible size to fill, leaving no empty space. Image may be cropped. * Auto: Scales the background image in the corresponding direction such that its intrinsic proportions are maintained.'; # Crafted by Catalyst IT @@ -81,7 +82,7 @@ https://www.catalyst-au.net/ # Contributing and Support -Issues, and pull requests using github are welcome and encouraged! +Issues, and pull requests using github are welcome and encouraged! https://github.com/catalyst/moodle-format_twocol/issues diff --git a/classes/output/courseformat/content.php b/classes/output/courseformat/content.php index e2278c2..ea6cccb 100644 --- a/classes/output/courseformat/content.php +++ b/classes/output/courseformat/content.php @@ -65,7 +65,7 @@ public function export_for_template(renderer_base $output): stdClass { $data = new stdClass(); $format = $this->format; - $displaysection = $format->get_section_number(); + $displaysection = $format->get_sectionnum(); if (!empty($displaysection)) { $data->singlesectionpage = $this->print_single_section_page($output); } else { @@ -274,7 +274,7 @@ public function print_course_summary(renderer_base $output): stdClass { */ public function print_single_section_page(renderer_base $output): stdClass { $format = $this->format; - $displaysection = $format->get_section_number(); + $displaysection = $format->get_sectionnum(); $course = $format->get_course(); $modinfo = get_fast_modinfo($course); diff --git a/format.php b/format.php index 0b46cb5..866c645 100644 --- a/format.php +++ b/format.php @@ -41,13 +41,10 @@ $renderer = $PAGE->get_renderer('format_twocol'); if (!empty($displaysection)) { - $format->set_section_number($displaysection); + $format->set_sectionnum($displaysection); } $outputclass = $format->get_output_classname('content'); $output = new $outputclass($format); echo $renderer->render($output); -// Include course format js module. We are reusing the core topics format JS. -$PAGE->requires->js('/course/format/topics/format.js'); - diff --git a/templates/course_summary.mustache b/templates/course_summary.mustache index 5f9f4d1..0d4c721 100644 --- a/templates/course_summary.mustache +++ b/templates/course_summary.mustache @@ -41,7 +41,7 @@ {{#courseimage}}style='background-image: url("{{{courseimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/courseimage}} {{^courseimage}}style='background-color: {{{headerbackcolor}}};'{{/courseimage}} > - {{#str}}aria:courseimage, core_course{{/str}} + {{fullname}} {{> format_twocol/progress_bar }}
diff --git a/templates/course_summary_reverse.mustache b/templates/course_summary_reverse.mustache index c5e69f7..57ad720 100644 --- a/templates/course_summary_reverse.mustache +++ b/templates/course_summary_reverse.mustache @@ -107,7 +107,7 @@ {{#courseimage}}style='background-image: url("{{{courseimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/courseimage}} {{^courseimage}}style='background-color: {{{headerbackcolor}}};'{{/courseimage}} > - {{#str}}aria:courseimage, core_course{{/str}} + {{fullname}} {{> format_twocol/progress_bar }}
diff --git a/templates/course_topic.mustache b/templates/course_topic.mustache index 1f9b684..c9975fc 100644 --- a/templates/course_topic.mustache +++ b/templates/course_topic.mustache @@ -36,7 +36,7 @@ {{#sectionimage}}style='background-image: url("{{{sectionimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/sectionimage}} {{^sectionimage}}style='background-color: {{{headerbackcolor}}};'{{/sectionimage}} > - {{#str}}aria:courseimage, core_course{{/str}} + {{fullname}} {{> format_twocol/progress_bar }}
diff --git a/version.php b/version.php index 16b4e99..cbc0ce9 100644 --- a/version.php +++ b/version.php @@ -25,10 +25,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = 'format_twocol'; -$plugin->release = '2022071005'; -$plugin->version = 2022071005; -$plugin->requires = 2022041900; +$plugin->release = '2024090200'; +$plugin->version = 2024090200; +$plugin->requires = 2024042200; $plugin->maturity = MATURITY_STABLE; -$plugin->dependencies = array( - 'format_topics' => 2019052000, -); +$plugin->supported = [404, 404];