mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-63466 core_message: don't reorder messages when formatting
- Removed the reordering code from helper::get_conversation_messages() - Added unit test confirming sort param behaviour for the api::get_conversations_messages() method.
This commit is contained in:
parent
d1e8e69d85
commit
b95e4c786c
2 changed files with 67 additions and 7 deletions
|
@ -202,13 +202,6 @@ class helper {
|
|||
// Store the messages.
|
||||
$arrmessages = array();
|
||||
|
||||
// We always view messages from oldest to newest, ensure we have it in that order.
|
||||
$lastmessage = end($messages);
|
||||
$firstmessage = reset($messages);
|
||||
if ($lastmessage->timecreated < $firstmessage->timecreated) {
|
||||
$messages = array_reverse($messages);
|
||||
}
|
||||
|
||||
foreach ($messages as $message) {
|
||||
// Store the message information.
|
||||
$msg = new \stdClass();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue