This issue has been highlighted by a failing test: ISSUESLIP displays checkouts in random order I thought it was because of dates comparison, but it comes from the following line in C4::Letters::_get_tt_params my $objects = $module->search( { $key => { -in => $values } } ); The DBMS will return data like there is ordered in the DB. For instance: select borrowernumber from borrowers where borrowernumber in (5, 3, 1); or select borrowernumber from borrowers where borrowernumber=5 or borrowernumber=3 or borrowernumber=1; will return 1, 3, 5
Created attachment 66985 [details] [review] Bug 19277: TT syntax - Display ordered data This issue has been highlighted by a failing test: ISSUESLIP displays checkouts in random order I thought it was because of dates comparison, but it comes from the following line in C4::Letters::_get_tt_params my $objects = $module->search( { $key => { -in => $values } } ); The DBMS will return data like there is ordered in the DB. For instance: select borrowernumber from borrowers where borrowernumber in (5, 3, 1); or select borrowernumber from borrowers where borrowernumber=5 or borrowernumber=3 or borrowernumber=1; will return 1, 3, 5 I did not find a generic way to do that, so used "ORDER BY FIELD" which will not be portable. Test plan: If you do not apply this patch, the tests will sometime fail
Created attachment 66986 [details] [review] Bug 19277: Make sure the tests will pass even if they are slow This patch was my first attempt to fix the issue. I think it is good to have it, if issue.timestamp and issue.issuedate are the same, the result will be orderd by issue_id. The tests highlight the fact that checkouts must be displayed in the correct order.
Created attachment 67000 [details] [review] Bug 19277: TT syntax - Display ordered data This issue has been highlighted by a failing test: ISSUESLIP displays checkouts in random order I thought it was because of dates comparison, but it comes from the following line in C4::Letters::_get_tt_params my $objects = $module->search( { $key => { -in => $values } } ); The DBMS will return data like there is ordered in the DB. For instance: select borrowernumber from borrowers where borrowernumber in (5, 3, 1); or select borrowernumber from borrowers where borrowernumber=5 or borrowernumber=3 or borrowernumber=1; will return 1, 3, 5 I did not find a generic way to do that, so used "ORDER BY FIELD" which will not be portable. Test plan: If you do not apply this patch, the tests will sometime fail Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Created attachment 67001 [details] [review] Bug 19277: Make sure the tests will pass even if they are slow This patch was my first attempt to fix the issue. I think it is good to have it, if issue.timestamp and issue.issuedate are the same, the result will be orderd by issue_id. The tests highlight the fact that checkouts must be displayed in the correct order. Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Created attachment 67043 [details] [review] Bug 19277: TT syntax - Display ordered data This issue has been highlighted by a failing test: ISSUESLIP displays checkouts in random order I thought it was because of dates comparison, but it comes from the following line in C4::Letters::_get_tt_params my $objects = $module->search( { $key => { -in => $values } } ); The DBMS will return data like there is ordered in the DB. For instance: select borrowernumber from borrowers where borrowernumber in (5, 3, 1); or select borrowernumber from borrowers where borrowernumber=5 or borrowernumber=3 or borrowernumber=1; will return 1, 3, 5 I did not find a generic way to do that, so used "ORDER BY FIELD" which will not be portable. Test plan: If you do not apply this patch, the tests will sometime fail Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 67044 [details] [review] Bug 19277: Make sure the tests will pass even if they are slow This patch was my first attempt to fix the issue. I think it is good to have it, if issue.timestamp and issue.issuedate are the same, the result will be orderd by issue_id. The tests highlight the fact that checkouts must be displayed in the correct order. Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 17.11, thanks to everybody involved!
Depends on Bug 17966 not in 17.05.x