ndunand / moodle-mod_choicegroup

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

Issue with Course Completion in Moodle 4.3 #200

Closed opitz closed 10 months ago

opitz commented 11 months ago

Hi @ndunand ,

There are issues with the Course Completion.

If course completion is on and you try to view "Default activity completion" for a course the following error can be seen:

Could not add custom completion rule of module choicegroup to this form, this has to be fixed by the developer
[...]
Coding error detected, it must be fixed by a programmer: JavaScript collection has already been started.

This will break the page and needs to be fixed.

ndunand commented 11 months ago

Hi @opitz , Thanks for reporting. We'll try to reproduce and fix this. Please stay tuned for updates on this issue.

ndunand commented 11 months ago

Hello @opitz ,

I'm trying to reproduce this to test and review your fix in #201 . Could you please provide steps to reproduce the error ?

opitz commented 11 months ago

Sorry for the late reply.

` The function print_error() is deprecated. Please throw a new moodle_exception instance instead. line 3156 of /lib/deprecatedlib.php: call to debugging() line 78 of /mod/choicegroup/mod_form.php: call to print_error() line 217 of /lib/formslib.php: call to mod_choicegroup_mod_form->definition() line 127 of /course/moodleform_mod.php: call to moodleform->construct() line 96 of /completion/classes/defaultedit_form.php: call to moodleform_mod->construct() line 115 of /completion/classes/edit_base_form.php: call to core_completion_defaultedit_form->get_module_form() line 146 of /completion/classes/edit_base_form.php: call to core_completion_edit_base_form->add_custom_completion() line 178 of /completion/classes/form/form_trait.php: call to core_completion_edit_base_form->add_completion_rules() line 247 of /completion/classes/edit_base_form.php: call to core_completion_edit_base_form->add_completion_elements() line 118 of /completion/classes/defaultedit_form.php: call to core_completion_edit_base_form->definition() line 217 of /lib/formslib.php: call to core_completion_defaultedit_form->definition() line 45 of /completion/classes/defaultedit_form.php: call to moodleform->construct() line 89 of /course/classes/output/bulk_activity_completion_renderer.php: call to core_completion_defaultedit_form->construct() line 97 of /course/defaultcompletion.php: call to core_course_bulk_activity_completion_renderer->defaultcompletion() Could not add custom completion rule of module choicegroup to this form, this has to be fixed by the developer line 135 of /completion/classes/edit_base_form.php: call to debugging() line 146 of /completion/classes/edit_base_form.php: call to core_completion_edit_base_form->add_custom_completion() line 178 of /completion/classes/form/form_trait.php: call to core_completion_edit_base_form->add_completion_rules() line 247 of /completion/classes/edit_base_form.php: call to core_completion_edit_base_form->add_completion_elements() line 118 of /completion/classes/defaultedit_form.php: call to core_completion_edit_base_form->definition() line 217 of /lib/formslib.php: call to core_completion_defaultedit_form->definition() line 45 of /completion/classes/defaultedit_form.php: call to moodleform->construct() line 89 of /course/classes/output/bulk_activity_completion_renderer.php: call to core_completion_defaultedit_form->construct() line 97 of /course/defaultcompletion.php: call to core_course_bulk_activity_completion_renderer->defaultcompletion()

Warning: Undefined variable $customcompletionelements in /var/www/html/completion/classes/edit_base_form.php on line 136 Coding error detected, it must be fixed by a programmer: JavaScript collection has already been started.

More information about this error

Debug info: Error code: codingerror×Dismiss this notification Stack trace: line 1037 of /lib/pagelib.php: coding_exception thrown line 95 of /completion/classes/defaultedit_form.php: call to moodle_page->start_collecting_javascript_requirements() line 120 of /completion/classes/defaultedit_form.php: call to core_completion_defaultedit_form->get_module_form() line 217 of /lib/formslib.php: call to core_completion_defaultedit_form->definition() line 45 of /completion/classes/defaultedit_form.php: call to moodleform->construct() line 89 of /course/classes/output/bulk_activity_completion_renderer.php: call to core_completion_defaultedit_form->construct() line 97 of /course/defaultcompletion.php: call to core_course_bulk_activity_completion_renderer->defaultcompletion() `

ndunand commented 11 months ago

Thanks, we'll be looking into this and will let you know shortly.

NicoAlexH commented 10 months ago

Fixed by merging https://github.com/ndunand/moodle-mod_choicegroup/pull/201, thank you @opitz !