Skip to content

Commit

Permalink
Update lw-courses for Moodle39
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Mar 17, 2021
1 parent d218cf7 commit 5ebf36a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ function block_lw_courses_get_sorted_courses($showallcourses = false) {
global $USER , $DB;

$courses = block_lw_courses_get_my_courses($USER->id);
$mapping = $DB->get_records_menu('block_webshop_product' , [] ,'', 'course_id as id, locale_display_flag');
$mapping = $DB->get_records_menu('block_webshop_product' , [] ,'',
'course_id as id, locale_display_flag');
$site = get_site();

if (array_key_exists($site->id, $courses)) {
Expand Down
5 changes: 2 additions & 3 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,7 @@ public function welcome_area($msgcount) {
public function course_image($courserecord) {
global $CFG;

require_once($CFG->libdir . '/coursecatlib.php');
$course = new course_in_list($courserecord);
$course = new core_course_list_element($courserecord);
// Check to see if a file has been set on the course level.
if ($course->id > 0 && $course->get_course_overviewfiles()) {
foreach ($course->get_course_overviewfiles() as $file) {
Expand Down Expand Up @@ -579,7 +578,7 @@ public function course_image_defaults() {
* @throws moodle_exception
*/
public function course_description($course) {
$course = new course_in_list($course);
$course = new core_course_list_element($course);

$context = \context_course::instance($course->id);
$summary = external_format_string($course->summary, $context,
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Make sure they don't update this plugin, custom changes
// https://github.com/MFreakNL/moodle-block_lw_courses
// Works in Moodle 3.5
$plugin->version = 2021031700; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2022091701; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2018050800; // Requires this Moodle version.
$plugin->component = 'block_lw_courses'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit 5ebf36a

Please sign in to comment.