catalyst / moodle-mod_subcourse

Subcourse module for Moodle
https://moodle.org/plugins/mod_subcourse
GNU General Public License v3.0
24 stars 41 forks source link

get_completion_state() callback function have been deprecated #50

Closed mudrd8mz closed 1 year ago

mudrd8mz commented 3 years ago
$ sudo -u apache php admin/cli/scheduled_task.php --execute='\core\task\completion_regular_task'
Execute scheduled task: Calculate regular completion data (core\task\completion_regular_task)
... started 23:19:57. Current memory use 15.3MB.
Running completion_criteria_date->cron()
Running completion_criteria_activity->cron()
Running completion_criteria_duration->cron()
Running completion_criteria_grade->cron()
Running completion_criteria_course->cron()
Aggregating completions
Aggregating completions for user 3 in course 3
Marking complete
++ *_get_completion_state() callback functions such as subcourse_get_completion_state have been deprecated and should no longer be used. Please implement the custom completion class mod_subcourse\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 125 of /mod/subcourse/classes/observers.php: call to completion_info->update_state()
* line ? of unknownfile: call to mod_subcourse\observers::course_completed()
* line 155 of /lib/classes/event/manager.php: call to call_user_func()
* line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
* line 834 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
* line 173 of /completion/completion_completion.php: call to core\event\base->trigger()
* line 173 of /lib/classes/task/completion_regular_task.php: call to completion_completion->mark_complete()
* line 253 of /lib/cronlib.php: call to core\task\completion_regular_task->execute()
* line 167 of /admin/cli/scheduled_task.php: call to cron_run_inner_scheduled_task()
... used 73 dbqueries
... used 1.5097651481628 seconds
Scheduled task complete: Calculate regular completion data (core\task\completion_regular_task)
rjnl commented 1 year ago

You also get this warning when editing the subcourse activity:

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

line 734 of /lib/completionlib.php: call to debugging()
line 671 of /lib/completionlib.php: call to completion_info->internal_get_state()
line 1010 of /lib/completionlib.php: call to completion_info->update_state()
line 714 of /course/modlib.php: call to completion_info->reset_all_state()
line 173 of /course/modedit.php: call to update_moduleinfo()
danmarsden commented 1 year ago

partial patch for this in the closed (old) PR #58 - would be good for someone to create a PR with just that change on it's own to look at merging it in - if no one else does this I'll see what I can do...