Summary: | TT syntax - Data is not ordered in notices | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | fridolin.somers, tomascohen |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 17966 | ||
Bug Blocks: | |||
Attachments: |
Bug 19277: TT syntax - Display ordered data
Bug 19277: Make sure the tests will pass even if they are slow Bug 19277: TT syntax - Display ordered data Bug 19277: Make sure the tests will pass even if they are slow Bug 19277: TT syntax - Display ordered data Bug 19277: Make sure the tests will pass even if they are slow |
Description
Jonathan Druart
2017-09-08 12:37:27 UTC
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! |