-
Bug
-
Resolution: Fixed
-
Minor
-
4.5
-
1
-
Team Hedgehog 2024 Review 4, Team Hedgehog 2024 Sprint 4.1
The argument `sort` to the core_user\table\participants_search::get_participants method used to require the "ORDER BY" statement, since MDL-78030 it can no longer contain it or it causes an SQL error. This issue may affect other arguments too.
Proof by unit test
Add the following snippet to user/tests/table/participants_search_test.php.
public function test_sort() { |
$course = $this->getDataGenerator()->create_course(); |
$coursecontext = context_course::instance($course->id); |
$this->create_course_with_users(1, 1, 1, 1); |
|
$filterset = new participants_filterset(); |
$search = new participants_search($course, $coursecontext, $filterset); |
|
$rs = $search->get_participants('', [], 'ORDER BY id'); |
$rs->close(); |
}
|
Run the tests on 4.4 and 4.5.
vendor/bin/phpunit user/tests/table/participants_search_test.php
|
Expected: The tests pass
Actual: The tests fail with database error on 4.5
Removing the "ORDER BY" part in the test will cause the test to fail on 4.4.
- is a regression caused by
-
MDL-78030 Make tablelib and reports faster by combining count query into main query
-
- Closed
-