From cc8bd704aef3ee18267a5b6176ea04f999912ab9 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 16 May 2014 12:48:28 +0800 Subject: [PATCH] MDL-41708 mod_forum: Show attachments in lexical order This matches the order in which they're shown in the file manager. --- mod/forum/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 15ae0a602e8..3643686cf09 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -4042,7 +4042,9 @@ function forum_print_attachments($post, $cm, $type) { require_once($CFG->libdir.'/portfoliolib.php'); } - $files = $fs->get_area_files($context->id, 'mod_forum', 'attachment', $post->id, "timemodified", false); + // We retrieve all files according to the time that they were created. In the case that several files were uploaded + // at the sametime (e.g. in the case of drag/drop upload) we revert to using the filename. + $files = $fs->get_area_files($context->id, 'mod_forum', 'attachment', $post->id, "filename", false); if ($files) { if ($canexport) { $button = new portfolio_add_button();