From d76029110bc7ce426b3c8219cf6532b64fc640c4 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Fri, 9 Nov 2018 17:27:55 +0800 Subject: [PATCH] MDL-63884 core_message: fix for get_conversations legacy adapter code This code also tries to adapt other conversation types, but it should only support individual conversations, where we know members exist. --- message/classes/helper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/message/classes/helper.php b/message/classes/helper.php index 1927b643ee2..732268434ab 100644 --- a/message/classes/helper.php +++ b/message/classes/helper.php @@ -540,6 +540,10 @@ class helper { // Transform new data format back into the old format, just for BC during the deprecation life cycle. $tmp = []; foreach ($conversations as $id => $conv) { + // Only individual conversations were supported in legacy messaging. + if ($conv->type != \core_message\api::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL) { + continue; + } $data = new \stdClass(); // The logic for the 'other user' is as follows: // If a conversation is of type 'individual', the other user is always the member who is not the current user.