From 76a8aef9a1d616b37b0bc13998579ab7ba587385 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Fri, 27 May 2011 10:07:26 +0100 Subject: [PATCH] MDL-27171 messages: allow using user IDs instead of objects in message_send function Signed-off-by: Ruslan Kabalin --- lib/messagelib.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/messagelib.php b/lib/messagelib.php index e74032ed2db..f783558a791 100644 --- a/lib/messagelib.php +++ b/lib/messagelib.php @@ -34,8 +34,8 @@ defined('MOODLE_INTERNAL') || die(); * Required parameter $eventdata structure: * component string component name. must exist in message_providers * name string message type name. must exist in message_providers - * userfrom object the user sending the message - * userto object the message recipient + * userfrom object|int the user sending the message + * userto object|int the message recipient * subject string the message subject * fullmessage - the full message in a given format * fullmessageformat - the format if the full message (FORMAT_MOODLE, FORMAT_HTML, ..) @@ -57,11 +57,9 @@ function message_send($eventdata) { $DB->transactions_forbidden(); if (is_int($eventdata->userto)) { - mtrace('message_send() userto is a user ID when it should be a user object'); $eventdata->userto = $DB->get_record('user', array('id' => $eventdata->userto)); } if (is_int($eventdata->userfrom)) { - mtrace('message_send() userfrom is a user ID when it should be a user object'); $eventdata->userfrom = $DB->get_record('user', array('id' => $eventdata->userfrom)); }