From c461e6a47623cb4777b014c723a5bf92b02d2955 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 1 Jul 2022 11:54:34 -0300 Subject: [PATCH] Bug 29418: Fix error searching for analytics in detail view This patch fixes the problem of searching for analytics when the title contains reserved characters like ? To test: 1. Have a record with ? in the title 2. Open the detail view (staff) => FAIL: tells there's an error checking for analytics 3. Open the detail view (OPAC) => FAIL: tells there's an error checking for analytics 4. Apply this patch and restart all 5. Repeat 2 and 3 => SUCCESS: Link shows correctly! 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- catalogue/detail.pl | 2 +- opac/opac-detail.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index f81d1436f4..8db8bf5dd7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -138,7 +138,7 @@ if ( $xslfile ) { my $query = ( C4::Context->preference('UseControlNumber') and $record->field('001') ) ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)' - : "Host-item:($cleaned_title)"; + : "Host-item:(\"$cleaned_title\")"; my ( $err, $result, $count ); eval { ( $err, $result, $count ) = diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index c2225a69a9..255b07aeef 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -195,7 +195,7 @@ if ( $xslfile ) { my $query = ( C4::Context->preference('UseControlNumber') and $record->field('001') ) ? 'rcn:'. $record->field('001')->data . ' AND (bib-level:a OR bib-level:b)' - : "Host-item:($cleaned_title)"; + : "Host-item:(\"$cleaned_title\")"; my ( $err, $result, $count ); eval { ( $err, $result, $count ) = -- 2.34.1