ndunand / moodle-mod_choicegroup

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

choicegroup_get_completion_state have been deprecated #152

Closed ndunand closed 3 years ago

ndunand commented 3 years ago

In Moodle 3.11, we have the following warnings when using automatic completion:

*_get_completion_state() callback functions such as choicegroup_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_choicegroup\completion\custom_completion which extends \core_completion\activity_custom_completion.

line 731 of /lib/completionlib.php: call to debugging()
line 652 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 988 of /lib/completionlib.php: call to completion_info->update_state()
line 661 of /course/modlib.php: call to completion_info->reset_all_state()
line 166 of /course/modedit.php: call to update_moduleinfo()

Offending code in https://github.com/ndunand/moodle-mod_choicegroup/blob/master/lib.php#L1040 .

Example implementation in /mod/choice/classes/completion/custom_completion.php

ndunand commented 3 years ago

fixed by 14cb64ce6bc1ea1cc797d419f6f5d44d26c55cbc