diff --git a/locallib.php b/locallib.php index 77935ce..775d691 100644 --- a/locallib.php +++ b/locallib.php @@ -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)) { diff --git a/renderer.php b/renderer.php index 55790bd..46b11d5 100644 --- a/renderer.php +++ b/renderer.php @@ -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) { @@ -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, diff --git a/version.php b/version.php index cc720a7..372c580 100644 --- a/version.php +++ b/version.php @@ -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;