From 7dc18af36d962403e035a1442c86d0c89dc612b3 Mon Sep 17 00:00:00 2001 From: Nick Clemens 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 --- 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 /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q= + /cgi-bin/koha/catalogue/search.pl?q= + abcdfgklmnopqrstvxyz AND (su: @@ -1578,7 +1579,14 @@ /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q=au:"" + /cgi-bin/koha/catalogue/search.pl?q=au:" + + abcdfgklmnopqrstvxyz + AND + (au: + ) + 1 + -- 2.30.2