From 4595c79b74e69f1906ebc6567c92d9aad786c738 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Mon, 17 Mar 2014 13:53:07 +0100 Subject: [PATCH] MDL-44408 Adding missing order (so we start looking for newest discussions) --- mod/forum/externallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/forum/externallib.php b/mod/forum/externallib.php index 81d3c80b973..862d299f4f4 100644 --- a/mod/forum/externallib.php +++ b/mod/forum/externallib.php @@ -245,7 +245,8 @@ class mod_forum_external extends external_api { // The forum function returns the replies for all the discussions in a given forum. $replies = forum_count_discussion_replies($id); // Get the discussions for this forum. - if ($discussions = $DB->get_records('forum_discussions', array('forum' => $id), '', '*', $limitfrom, $limitnum)) { + $order = 'timemodified DESC'; + if ($discussions = $DB->get_records('forum_discussions', array('forum' => $id), $order, '*', $limitfrom, $limitnum)) { foreach ($discussions as $discussion) { // If the forum is of type qanda and the user has not posted in the discussion // we need to ensure that they have the required capability.