From aea298fc35ecd8a410874ce1ac6fcfd4b80a0462 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Sun, 29 Jun 2014 16:18:24 -0700 Subject: [PATCH] MDL-45594 core_message: ordered recent notifications by timecreated --- message/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message/lib.php b/message/lib.php index ec0cbf96452..8af7999e148 100644 --- a/message/lib.php +++ b/message/lib.php @@ -791,7 +791,7 @@ function message_get_recent_notifications($user, $limitfrom=0, $limitto=100) { FROM {message_read} mr JOIN {user} u ON u.id=mr.useridfrom WHERE mr.useridto = :userid1 AND u.deleted = '0' AND mr.notification = :notification - ORDER BY mr.id DESC";//ordering by id should give the same result as ordering by timecreated but will be faster + ORDER BY mr.timecreated DESC"; $params = array('userid1' => $user->id, 'notification' => 1); $notifications = $DB->get_records_sql($sql, $params, $limitfrom, $limitto);