Bug 11923

Summary: Marc record batches not sorting by citation descending
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: MARC Bibliographic record staging/importAssignee: Kyle M Hall (khall) <kyle>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 10558    
Bug Blocks:    
Attachments: Bug 11923 - Marc record batches not sorting by citation descending
[SIGNED-OFF] Bug 11923 - Marc record batches not sorting by citation descending
Bug 11923 - Marc record batches not sorting by citation descending

Description Kyle M Hall (khall) 2014-03-11 14:34:37 UTC
When the ability to stage authority records was added to Koha, sorting record batches by citation ( i.e. title ) caused the addition of "authorized_heading" to be added to the sort. When sorting by title descending, this causes the order by clause to be "title, authorized_heading DESC" which means sort by title ASC, then authorized_heading DESC. This is incorrect and causes regular biblio batches to always be sorted ascending.
Comment 1 Kyle M Hall (khall) 2014-03-11 14:35:57 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-03-11 16:12:51 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2014-03-13 12:43:30 UTC
Created attachment 26265 [details] [review]
Bug 11923 - Marc record batches not sorting by citation descending

When the ability to stage authority records was added to Koha, sorting
record batches by citation ( i.e. title ) caused the addition of
"authorized_heading" to be added to the sort. When sorting by title
descending, this causes the order by clause to be "title,
authorized_heading DESC" which means sort by title ASC, then
authorized_heading DESC. This is incorrect and causes regular biblio
batches to always be sorted ascending.

Test plan:
1) Stage a batch of biblio records from a file
2) View the staged batch
3) Attempt to sort by title descending
4) Note it is still sorted by title ascending
5) Apply this patch
6) Note the sorting now works correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Works as advertised. The code pertaining to sorting in routine
GetImportRecordsRange will probably not win beauty prizes.
Comment 4 Galen Charlton 2014-03-13 15:33:28 UTC
Pushed to master.  Thanks, Kyle!
Comment 5 Fridolin Somers 2014-06-12 07:57:11 UTC
Depends on Bug 10558, so I set has resolved