mirror of
https://github.com/moodle/moodle.git
synced 2025-04-08 01:43:32 +02:00
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:
parent
d188d58ce9
commit
f6e7eb2ebd
@ -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,
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user