Bugzilla – Attachment 26265 Details for
Bug 11923
Marc record batches not sorting by citation descending
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11923 - Marc record batches not sorting by citation descending
Bug-11923---Marc-record-batches-not-sorting-by-cit.patch (text/plain), 2.14 KB, created by
Marcel de Rooy
on 2014-03-13 12:43:30 UTC
(
hide
)
Description:
Bug 11923 - Marc record batches not sorting by citation descending
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-03-13 12:43:30 UTC
Size:
2.14 KB
patch
obsolete
>From 4b4911bfdb8098b0bfbe34986d670ffaf674ea2c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 11 Mar 2014 10:34:40 -0400 >Subject: [PATCH] Bug 11923 - Marc record batches not sorting by citation > descending >Content-Type: text/plain; charset=utf-8 > >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. >--- > C4/ImportBatch.pm | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 6ddab77..66162c7 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -1034,11 +1034,12 @@ sub GetImportRecordsRange { > > my $order_by = $parameters->{order_by} || 'import_record_id'; > ( $order_by ) = grep( /^$order_by$/, qw( import_record_id title status overlay_status ) ) ? $order_by : 'import_record_id'; >- $order_by .= ",authorized_heading" if $order_by eq 'title'; > > my $order_by_direction = > uc( $parameters->{order_by_direction} ) eq 'DESC' ? 'DESC' : 'ASC'; > >+ $order_by .= " $order_by_direction, authorized_heading" if $order_by eq 'title'; >+ > my $query = "SELECT title, author, isbn, issn, authorized_heading, import_records.import_record_id, > record_sequence, status, overlay_status, > matched_biblionumber, matched_authid, record_type >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11923
:
26111
|
26126
| 26265