mirror of
https://github.com/moodle/moodle.git
synced 2025-04-27 03:14:20 +02:00
MDL-47162 badges: site & profile badges do not have courseid
Because of that, we need to set the, now mandatory, SITEID for those message events to be happy. This does not affect course or activity badges, both coming with correct courseid.
This commit is contained in:
parent
9bf205fb73
commit
f593e8271a
@ -723,7 +723,7 @@ function badges_notify_badge_award(badge $badge, $userid, $issued, $filepathhash
|
||||
|
||||
// Notify recipient.
|
||||
$eventdata = new \core\message\message();
|
||||
$eventdata->courseid = $badge->courseid;
|
||||
$eventdata->courseid = is_null($badge->courseid) ? SITEID : $badge->courseid; // Profile/site come with no courseid.
|
||||
$eventdata->component = 'moodle';
|
||||
$eventdata->name = 'badgerecipientnotice';
|
||||
$eventdata->userfrom = $userfrom;
|
||||
|
Loading…
x
Reference in New Issue
Block a user