MDL-64588 core_comment: fix get_comment ordering when timestamps match

Include id in the sorting, to be sure that we always get the correct
record in cases where the comment timestamps are the same.
This commit is contained in:
Jake Dallimore 2019-09-17 11:26:45 +08:00
parent 6cd3d398a9
commit ae94d477a6

View File

@ -566,7 +566,7 @@ class comment {
c.commentarea = :commentarea AND
c.itemid = :itemid AND
$componentwhere
ORDER BY c.timecreated $sortdirection";
ORDER BY c.timecreated $sortdirection, c.id $sortdirection";
$params['contextid'] = $this->contextid;
$params['commentarea'] = $this->commentarea;
$params['itemid'] = $this->itemid;