From 62a5479df65942ee36f3191433f7983250666cf9 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 14 Aug 2018 15:59:00 +1000 Subject: [PATCH] fix: Fixes actor in User Enrolments to close #224. (#226) --- src/transformer/events/core/user_enrolment_created.php | 2 +- .../user_enrolment_created/existing_user_enrolled/event.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformer/events/core/user_enrolment_created.php b/src/transformer/events/core/user_enrolment_created.php index 1ccee4ace..5bed80134 100644 --- a/src/transformer/events/core/user_enrolment_created.php +++ b/src/transformer/events/core/user_enrolment_created.php @@ -22,7 +22,7 @@ function user_enrolment_created(array $config, \stdClass $event) { $repo = $config['repo']; - $user = $repo->read_record_by_id('user', $event->userid); + $user = $repo->read_record_by_id('user', $event->relateduserid); $course = $repo->read_record_by_id('course', $event->courseid); $lang = utils\get_course_lang($course); diff --git a/tests/core/user_enrolment_created/existing_user_enrolled/event.json b/tests/core/user_enrolment_created/existing_user_enrolled/event.json index 5488be97e..5f0c1129b 100644 --- a/tests/core/user_enrolment_created/existing_user_enrolled/event.json +++ b/tests/core/user_enrolment_created/existing_user_enrolled/event.json @@ -1,6 +1,6 @@ { "id": 1, - "userid": 1, + "relateduserid": 1, "courseid": 1, "timecreated": 1433946701, "objecttable": "user",