Microsoft 365 Teams error: exception- class'mod_assign_render' not found

Microsoft 365 Teams error: exception- class'mod_assign_render' not found

by Rachid Elsabah -
Number of replies: 2

Microsoft 365 Teams Theme error with Moodle 4 error: exception- class'mod_assign_render' not found
Stack trace
line 37 of /theme/boost_o365teams/renderers.php:Error thrown

This is infact the error blocking the theme selector

Average of ratings: -
In reply to Rachid Elsabah

Re: Microsoft 365 Teams error: exception- class'mod_assign_render' not found

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you're talking about https://moodle.org/plugins/theme_boost_o365teams, I don't see a version of it compatible with Moodle 4.

It's unlikely any theme will work with M4 unless updated/modified.

To fix it, edit your config.php and add

$CFG->theme = 'boost';
In reply to Howard Miller

Re: Microsoft 365 Teams error: exception- class'mod_assign_render' not found

by Rachid Elsabah -
this is a quick overriding of the error:
The changes (three lines) are in the file
moodle/theme/boost_o365teams/renderers.php

In line 28
change
require_once($CFG->dirroot . '/mod/assign/renderer.php');
to
require_once($CFG->dirroot . '/mod/assign/classes/output/renderer.php');
as the renderer.php was moved to another location.

In line 37 change
class theme_boost_o365teams_mod_assign_renderer extends mod_assign_renderer {
to
class theme_boost_o365teams_mod_assign_renderer extends \mod_assign\output\renderer {

And in line 44 change
public function render_assign_header(assign_header $header) {
to
public function render_assign_header(mod_assign\output\assign_header $header) {

That's all I had to make it work again.

Code source :
Daniel M github