Bug 11923 - Marc record batches not sorting by citation descending
Summary: Marc record batches not sorting by citation descending
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic record staging/import (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 10558
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-11 14:34 UTC by Kyle M Hall
Modified: 2015-06-04 23:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11923 - Marc record batches not sorting by citation descending (1.88 KB, patch)
2014-03-11 14:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 11923 - Marc record batches not sorting by citation descending (1.98 KB, patch)
2014-03-11 16:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 11923 - Marc record batches not sorting by citation descending (2.14 KB, patch)
2014-03-13 12:43 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 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 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