MDL-63692 message: Correct favourite fetch
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 20 Nov 2018 06:34:49 +0000 (14:34 +0800)
committerJun Pataleta <jun@moodle.com>
Tue, 20 Nov 2018 06:40:39 +0000 (14:40 +0800)
message/classes/api.php

index 68e290b..86a22f8 100644 (file)
@@ -963,7 +963,7 @@ class api {
         global $DB;
 
         // Get the context for this conversation.
-        $conversation = $DB->get_records('message_conversations', ['id' => $conversationid]);
+        $conversation = $DB->get_record('message_conversations', ['id' => $conversationid]);
         $userctx = \context_user::instance($userid);
         if (empty($conversation->contextid)) {
             // When the conversation hasn't any contextid value defined, the favourite will be added to the user context.