MDL-62993 ltiservice_memberships: make message an array per spec
authorClaude Vervoort <claude.vervoort@cengage.com>
Thu, 26 Jul 2018 15:20:04 +0000 (11:20 -0400)
committerMark Nelson <markn@moodle.com>
Mon, 30 Jul 2018 02:05:46 +0000 (10:05 +0800)
Also added resultSourcedId to member for BC.

mod/lti/service/memberships/classes/local/service/memberships.php

index ed6a071..052ef3a 100644 (file)
@@ -229,8 +229,10 @@ class memberships extends \mod_lti\local\ltiservice\service_base {
                                                                                      $user->id,
                                                                                      $lti->servicesalt,
                                                                                      $lti->typeid));
+                    // Not per specification but added to comply with earlier version of the service.
+                    $member->resultSourcedId = $message->lis_result_sourcedid;
                 }
-                $membership->message = $message;
+                $membership->message = [$message];
             }
 
             foreach ($includedcapabilities as $capabilityname => $capability) {