Skip to content

Commit

Permalink
Fix mdl 404 errors (#46)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rajandangi authored Sep 3, 2024
1 parent 58b7afb commit 35a265f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions classes/output/courseformat/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions format.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

2 changes: 1 addition & 1 deletion templates/course_summary.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{#courseimage}}style='background-image: url("{{{courseimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/courseimage}}
{{^courseimage}}style='background-color: {{{headerbackcolor}}};'{{/courseimage}}
>
<span class="sr-only">{{#str}}aria:courseimage, core_course{{/str}}</span>
<span class="sr-only">{{fullname}}</span>
{{> format_twocol/progress_bar }}
</div>
<div class="section">
Expand Down
2 changes: 1 addition & 1 deletion templates/course_summary_reverse.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
{{#courseimage}}style='background-image: url("{{{courseimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/courseimage}}
{{^courseimage}}style='background-color: {{{headerbackcolor}}};'{{/courseimage}}
>
<span class="sr-only">{{#str}}aria:courseimage, core_course{{/str}}</span>
<span class="sr-only">{{fullname}}</span>
{{> format_twocol/progress_bar }}
</div>
<div class="section">
Expand Down
2 changes: 1 addition & 1 deletion templates/course_topic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{#sectionimage}}style='background-image: url("{{{sectionimage}}}"), linear-gradient({{{headerbackcolor}}}, {{{headerbackcolor}}});' {{/sectionimage}}
{{^sectionimage}}style='background-color: {{{headerbackcolor}}};'{{/sectionimage}}
>
<span class="sr-only">{{#str}}aria:courseimage, core_course{{/str}}</span>
<span class="sr-only">{{fullname}}</span>
{{> format_twocol/progress_bar }}
<h6 class="section-navigation-back">
<a href="{{{courseurl}}}" title="{{#str}}home_tip, format_twocol{{/str}}">
Expand Down
10 changes: 4 additions & 6 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

0 comments on commit 35a265f

Please sign in to comment.