MDL-60710 course: Fix incorrect reference to role
authorDavid Monllao <davidm@moodle.com>
Wed, 10 Oct 2018 08:57:43 +0000 (10:57 +0200)
committerDavid Monllao <davidm@moodle.com>
Wed, 10 Oct 2018 08:57:47 +0000 (10:57 +0200)
course/externallib.php

index e570119..cb699fa 100644 (file)
@@ -2266,7 +2266,7 @@ class core_course_external extends external_api {
                 'fullname' => $contact['username'],
                 'roles' => array_map(function($role){
                     return array('id' => $role->id, 'name' => $role->displayname);
-                }, $contact['role']),
+                }, $contact['roles']),
                 'role' => array('id' => $contact['role']->id, 'name' => $contact['role']->displayname),
                 'rolename' => $contact['rolename']
              );