Bugzilla – Attachment 151675 Details for
Bug 33802
On OPAC authority detail page, usage count in wrong (when using Elasticsearch)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33802: On OPAC authority detail page, usage count in erroneous
Bug-33802-On-OPAC-authority-detail-page-usage-coun.patch (text/plain), 1.62 KB, created by
David Nind
on 2023-05-25 12:42:43 UTC
(
hide
)
Description:
Bug 33802: On OPAC authority detail page, usage count in erroneous
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-05-25 12:42:43 UTC
Size:
1.62 KB
patch
obsolete
>From a3db9056ad29e7900f4eae776a5adce66c1ae258 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= <f.demians@tamil.fr> >Date: Tue, 23 May 2023 10:27:24 +0200 >Subject: [PATCH] Bug 33802: On OPAC authority detail page, usage count in > erroneous > >If QueryAutoTruncate is enabled, the biblio usage count of an authority >displayed on OPAC may be wrong. This is due to the fact that the authid >search being automatically truncated, a search for biblios using >authority 22 will retrieved also biblios using authorities 222, 22*. > >TO TEST: > >1. On a Koha with authorities, enable QueryAutoTruncate. >2. Go on opac-authoritiesdetail.pl page for an authority with the lowest > possible authid. Let say 1. >3. Confirm that you have a large biblios usage count, and that by > clicking on the link to see linked biblios, you get far less biblios > than expected. >4. Apply the patch. Repeat 2-3. > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Authorities.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Authorities.pm b/Koha/Authorities.pm >index 9d29346787..3345108a0c 100644 >--- a/Koha/Authorities.pm >+++ b/Koha/Authorities.pm >@@ -51,7 +51,7 @@ sub get_usage_count { > my $authid = $params->{authid} || return; > > my $searcher = Koha::SearchEngine::Search->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); >- my ( $err, $result, $count ) = $searcher->simple_search_compat( 'an:' . $authid, 0, 0 ); >+ my ( $err, $result, $count ) = $searcher->simple_search_compat( "an:\"$authid\"", 0, 0 ); > if( $err ) { > warn "Error: $err from search for " . $authid; > return; >-- >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 33802
:
151553
| 151675