MDL-79747 quiz stats: task should run as admin the right way
The correct way to get an ad-hoc task to run as the main admin account is to leave userid as null. Setting it causes fatal errors if the main admin account is set to auth: nologin.
This commit is contained in:
@@ -47,7 +47,6 @@ class recalculate extends \core\task\adhoc_task {
|
||||
public static function instance(int $quizid): recalculate {
|
||||
$task = new self();
|
||||
$task->set_component('quiz_statistics');
|
||||
$task->set_userid(get_admin()->id);
|
||||
$task->set_custom_data((object)[
|
||||
'quizid' => $quizid,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user