in classes/local/cli/clibase.php the function become_admin_user() has the line
$user = $DB->get_record('user', ['id' => 2]);
This is not robust for sites that change the user with userid=2.
The following exception is generated when this user is not present, or not an admin:
!!! Exception - Argument 1 passed to core\session\manager::set_user() must be an instance of stdClass, boolean given,
called in [dirroot]/auth/outage/classes/local/cli/clibase.php on line 130 !!!
Perhaps getting the userid of the primary site admin and using that would be a better approach.
in
classes/local/cli/clibase.php
the functionbecome_admin_user()
has the line$user = $DB->get_record('user', ['id' => 2]);
This is not robust for sites that change the user with userid=2. The following exception is generated when this user is not present, or not an admin:
Perhaps getting the userid of the primary site admin and using that would be a better approach.