Bugzilla – Attachment 1965 Details for
Bug 4265
Sorting by call number in OPAC is slightly off
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes padding of short callnumbers and Bib-1 attribute for sorting
0001-Bug-4265-Fix-padding-of-short-callnumbers-and-Bib-1-.patch (text/plain), 1.97 KB, created by
Chris Cormack
on 2010-02-25 21:11:00 UTC
(
hide
)
Description:
Fixes padding of short callnumbers and Bib-1 attribute for sorting
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-02-25 21:11:00 UTC
Size:
1.97 KB
patch
obsolete
>From 6ffcfe114f7323445441c04ba094f71c315e3cc4 Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@enger.priv.no> >Date: Thu, 25 Feb 2010 21:54:28 +0100 >Subject: [PATCH] Bug 4265: Fix padding of short callnumbers and Bib-1 attribute for sorting >Content-Type: text/plain; charset="utf-8" > >1. The current C4::ClassSortRoutine::Dewey turns "306 Les" into "306_Les" for items.cn_sort and MARC-field 952$6, which results in "306.46 Les" being sorted before "306 Les" in the OPAC. With this patch, "306 Les" is turned into "306_000000000000000_Les". > >2. Currently, call_number_asc and call_number_desc are set up to sort by 1=20, but this is mapped to Local-classification in ccl.properties, which is mapped to 952$o in record.abs. > >This patch changes these sorts to use 1=8007, which is mapped to cn-sort and 952$6. >--- > C4/ClassSortRoutine/Dewey.pm | 4 ++++ > C4/Search.pm | 4 ++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm >index dd768ba..0cbb844 100644 >--- a/C4/ClassSortRoutine/Dewey.pm >+++ b/C4/ClassSortRoutine/Dewey.pm >@@ -76,6 +76,10 @@ sub get_class_sort_key { > } > } > } >+ # Pad the first digit_group if there was only one >+ if (1 == $digit_group_count) { >+ $tokens[0] .= '_000000000000000' >+ } > my $key = join("_", @tokens); > $key =~ s/[^\p{IsAlnum}_]//g; > >diff --git a/C4/Search.pm b/C4/Search.pm >index 554174c..db55bee 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -364,10 +364,10 @@ sub getRecords { > $sort_by .= "1=9003 >i "; > } > elsif ( $sort eq "call_number_asc" ) { >- $sort_by .= "1=20 <i "; >+ $sort_by .= "1=8007 <i "; > } > elsif ( $sort eq "call_number_dsc" ) { >- $sort_by .= "1=20 >i "; >+ $sort_by .= "1=8007 >i "; > } > elsif ( $sort eq "pubdate_asc" ) { > $sort_by .= "1=31 <i "; >-- >1.6.3.3 >
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 4265
:
1964
| 1965 |
1966