Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort comments by timeposted AND id to avoid random behat failures #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ function oublog_get_posts($oublog, $context, $offset = 0, $cm, $groupid, $indivi
FROM {oublog_comments} c
LEFT JOIN {user} u ON c.userid = u.id
WHERE c.postid IN (".implode(",", $postids).") AND c.deletedby IS NULL
ORDER BY c.timeposted ASC ";
ORDER BY c.timeposted ASC, c.id ASC ";

$rs = $DB->get_recordset_sql($sql);
foreach ($rs as $comment) {
Expand Down Expand Up @@ -800,7 +800,7 @@ function oublog_get_post($postid, $canaudit=false) {
$sql .= "AND c.deletedby IS NULL ";
}

$sql .= "ORDER BY c.timeposted ASC ";
$sql .= "ORDER BY c.timeposted ASC, c.id ASC ";

$rs = $DB->get_recordset_sql($sql, array($postid));
foreach ($rs as $comment) {
Expand Down