ndunand / moodle-mod_choicegroup

Moodle "Group Choice" plugin
https://moodle.org/plugins/mod_choicegroup
35 stars 64 forks source link

Fix course menu in single activity course format #196

Closed detomon closed 1 year ago

detomon commented 1 year ago

This fixes an error when using choicegroup in a course with single activity format.

At the moment, selecting any item from the "Course" menu on the course view with single activity format will produce this error:

Error: has_capability(): Argument #2 ($context) must be of type context, null given, called in [dirroot]/mod/choicegroup/lib.php on line 1041

It now uses settings_navigation to get the course module instead of the global $PAGE variable.

ndunand commented 1 year ago

Indeed that is a better way. Thanks @detomon for providing this. We'll review and integrate