You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transformer generates exceptions if the userid = 0 ( \core\event\course_viewed and \core\event\user_created). More generally the user ( guest? ) is not in the database, so every transformer that uses it fails.
// Get a valid user for guest.
$guest = false;
if ($event->userid == 0) {
$guest = true;
if (isset($CFG->siteguest)) {
$event->userid = $CFG->siteguest;
}
}
$user = $repo->read_record_by_id('user', $event->userid);
// Reset userid so it is the same as in logstore_standard_log.
if ($guest == true) {
$event->userid = 0;
}
Would it be possible to create a branch and put this in for code review in the following files:
course_viewed.php
user_created.php
Description
Version
Steps to reproduce the bug
Expected behaviour
Actual behaviour
Server information
Client information
Thank you.
The text was updated successfully, but these errors were encountered: