Hello All,
It appears in Moodle 3.6 that class "coursecat" is going away. Any idea on how to use the new class? Is it as simple as just replacing out coursecat for something else?
Chris
Hi Chris,
I'm inclined to think this is really a 'General development' question rather than a theme one and thus really needs to be asked there. So will think a short while then may move the post.
Where did you get the information from, does that not tell you what to do?
G
I installed Fordson on the latest Moodle 3.6 download. Had debug turned on and it was showing errors on course listing pages.
I guess it should be moved to general Dev forum because it's related to the course renderer override in the theme. Others will have this issue too.
Are you sure it's generic error or is it actually a theme specific usage error? What is the stack trace?
And I get these on the Site Homepage when displaying courses.
Ok, the stack trace states the file. The git commit log for that file reports both the MDL being 'MDL-62742' and the commit, being: https://github.com/moodle/moodle/commit/442f12f81ae3be9fc27b712ec06b63f52653f4b7. That has all the information you need. Simple debugging.
Thanks Gareth! That certainly sheds some light on the situation.
I didn't look to git for commit logs but I think the initial warning messages spelled out what the issue was. I just wasn't sure about what needed to happen to correct it. My previous post outlines the actions I took and I believe this fixes the issue.
Chris
I am still testing all of this but it does appear to be a simple find and replace to point to the new class. I am still testing and verifying all this but it looks like I am back on track and will be ready to release a 3.6 version of Fordson.
For others who may experience this with their themes here is what I did. Most of my errors stemmed from course_renderer.php because we change the way courses are displayed and viewed in Fordson.
The first thing I did was add in the new classes at the top of the page and removed the classes no longer in the coursecat.php file:
//use coursecat;
use core_course_category;
//use course_in_list;
use core_course_list_element;
These are the two main culprits in my code: coursecat and course_in_list and I commented them out.
The next thing I did was search and replace where the classes were used.
Throughout the code I looked for "coursecat::" and replaced it with the new class "core_course_category::". Same for "course_in_list".
Lastly, I commented out any instance of this: "require_once ($CFG->libdir . '/coursecatlib.php');".
The error messages have gone away. I think this is fixed but maybe someone else has some insights.
Hope this helps the next person,
Chris
Thank you Chris! This worked for me