oliviervalentin / moodle-mod_stickynotes

Sticky Notes is a Moodle activity for creating an interactive post-it wall. Students can create, move and vote for notes, under supervision of teacher which can define colors, lock fucntionnalities...
Other
4 stars 6 forks source link

Error when using Sticky Notes as single course activity #22

Closed magali-lescano closed 1 year ago

magali-lescano commented 1 year ago

We have installed Sticky Notes in Moodle 4.1.4+ (Build: 20230707).

We have created a sticky notes activity inside a course. In the course configuration, we have selected the option "Single course activity", choosing the Sticky Notes activity as the single activity.

Once this is done, if we want to add participants to the course or change the course parameters, we get an error (and the only possible solution is to delete and create a new course or change the course format directly from the database):

Error Excepción - has_capability(): Argument #2 ($context) must be of type context, null given, called in [dirroot]/mod/stickynotes/lib.php on line 207 Debug info: Error code: generalexceptionmessage Stack trace: line 427 of /lib/accesslib.php: TypeError thrown line 207 of /mod/stickynotes/lib.php: call to has_capability() line 4880 of /lib/navigationlib.php: call to stickynotes_extend_settings_navigation() line 4342 of /lib/navigationlib.php: call to settings_navigation->load_module_settings() line 833 of /lib/pagelib.php: call to settings_navigation->initialise() line 962 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav() line 1124 of /lib/classes/navigation/views/secondary.php: call to moodle_page->get() line 214 of /lib/classes/navigation/views/secondary.php: call to core\navigation\views\secondary->load_single_activity_course_navigation() line 890 of /lib/pagelib.php: call to core\navigation\views\secondary->initialise() line 962 of /lib/pagelib.php: call to moodle_page->magic_get_secondarynav() line 77 of /theme/moove/layout/incourse.php: call to moodle_page->get() line 1477 of /lib/outputrenderers.php: call to include() line 1403 of /lib/outputrenderers.php: call to core_renderer->render_page_layout() line 1973 of /lib/setuplib.php: call to core_renderer->header() line 101 of /user/index.php: call to bootstrap_renderer->__call()

Thank you

oliviervalentin commented 1 year ago

Hi Magali, ok, found the bug. That was in function extending navigation for activity to add the export option. I fixed it in local, I will soon push a new version for the plugin integrating this modification. Thank you ! :) Olivier