Bugzilla – Attachment 144406 Details for
Bug 13976
Sorting search results by popularity is alphabetical
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13976: Sort popularity numerically in Zebra
Bug-13976-Sort-popularity-numerically-in-Zebra.patch (text/plain), 3.84 KB, created by
PTFS Europe Sandboxes
on 2022-12-02 18:32:55 UTC
(
hide
)
Description:
Bug 13976: Sort popularity numerically in Zebra
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2022-12-02 18:32:55 UTC
Size:
3.84 KB
patch
obsolete
>From 4f38c186fbc5a3d00ed5d48465ef2a6a44a335a1 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 21 Nov 2022 19:12:46 +0000 >Subject: [PATCH] Bug 13976: Sort popularity numerically in Zebra > >To test: >1 - Create a new template at Tools->Marc modification template >2 - Add action: Copy 999$c to 942$0 >3 - Create a report: > SELECT biblionuber FROM biblios >4 - Run report, show all, do a batch modification to all records using template above >5 - Search for 'a' (make sure you are using Zebra) >6 - Sort by popularity >7 - Note records are sorted wrong >8 - Apply patch >9 - Restart all >10 - Reload search results >11 - Success! Sorted correctly > >Signed-off-by: Anke <anke.bruns@gwdg.de> >--- > C4/Search.pm | 4 ++-- > .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 12 ++++++++++-- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index e6ad8b6ff3..9e0c15dac1 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -363,10 +363,10 @@ sub getRecords { > $sort_by .= "1=1003 >i "; > } > elsif ( $sort eq "popularity_asc" ) { >- $sort_by .= "1=9003 <i "; >+ $sort_by .= "1=9003,4=109 <i "; > } > elsif ( $sort eq "popularity_dsc" ) { >- $sort_by .= "1=9003 >i "; >+ $sort_by .= "1=9003,4=109 >i "; > } > elsif ( $sort eq "call_number_asc" ) { > $sort_by .= "1=8007 <i "; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index 0c807abf73..ee7dd176bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -658,7 +658,8 @@ > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:when test="$TraceSubjectSubdivisions='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject"> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q= >+ <xsl:call-template name="subfieldSelectSubject"> > <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> > <xsl:with-param name="delimeter"> AND </xsl:with-param> > <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >@@ -1578,7 +1579,14 @@ > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:" >+ <xsl:call-template name="subfieldSelectSubject"> >+ <xsl:with-param name="codes">abcdfgklmnopqrstvxyz</xsl:with-param> >+ <xsl:with-param name="delimeter"> AND </xsl:with-param> >+ <xsl:with-param name="prefix">(au:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> >+ <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param> >+ <xsl:with-param name="urlencode">1</xsl:with-param> >+ </xsl:call-template> > </xsl:otherwise> > </xsl:choose> > <xsl:choose> >-- >2.30.2
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 13976
:
141068
|
144115
|
144406
|
145963
|
148777