Closed detomon closed 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.
settings_navigation
$PAGE
Indeed that is a better way. Thanks @detomon for providing this. We'll review and integrate
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.