MDL-81632 block_recentlyaccesseditems: deterministic item ordering.
Behat tests of this functionality could trigger the unlikely (in real world usage) scenario where a user has an identical "timeaccess" value for multiple course activities. This led to random failures in said tests when the DB ordered items in apparently random order, where the "timeaccess" value was equal.
This commit is contained in:
@@ -58,7 +58,7 @@ class helper {
|
||||
FROM {block_recentlyaccesseditems} rai
|
||||
JOIN {course} c ON c.id = rai.courseid
|
||||
WHERE userid = :userid
|
||||
ORDER BY rai.timeaccess DESC";
|
||||
ORDER BY rai.timeaccess DESC, rai.id DESC";
|
||||
$records = $DB->get_records_sql($sql, $paramsql);
|
||||
$order = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user