I found this while trying to get overview information to print for a lesson.
In the my/index.php page, the method get_my_courses() is used to get an array of course objects. These course objects do not get their modinfo field set.
Later, the course objects are eventually passed to get_all_instances_in_courses() in the modules modname_print_overview(). This method (get_all_instances_in_courses) requires modinfo to be set otherwise it will skip that course resulting in an empty array being returned.
There are several ways to fix this, I leave that solution up to the developer assigned to the ticket.
- duplicates
-
MDL-10232 modinfo missing in get_my_courses
- Closed