Bugzilla – Attachment 47676 Details for
Bug 15745
C4::Matcher gets CCL parsing error if term contains ? (question mark)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15745 - C4::Matcher gets CCL parsing error if term contains ? (question mark)
Bug-15745---C4Matcher-gets-CCL-parsing-error-if-te.patch (text/plain), 1.89 KB, created by
David Cook
on 2016-02-05 06:16:11 UTC
(
hide
)
Description:
Bug 15745 - C4::Matcher gets CCL parsing error if term contains ? (question mark)
Filename:
MIME Type:
Creator:
David Cook
Created:
2016-02-05 06:16:11 UTC
Size:
1.89 KB
patch
obsolete
>From d3196bf0f899df24fc97d115b632dfad7e62d538 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Fri, 5 Feb 2016 16:09:45 +1100 >Subject: [PATCH] Bug 15745 - C4::Matcher gets CCL parsing error if term > contains ? (question mark) > >--- > C4/Matcher.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/C4/Matcher.pm b/C4/Matcher.pm >index 85474d2..174fcc4 100644 >--- a/C4/Matcher.pm >+++ b/C4/Matcher.pm >@@ -658,7 +658,8 @@ sub get_matches { > else { > my $phr = C4::Context->preference('AggressiveMatchOnISBN') ? ',phr' : q{}; > $query = join( " or ", >- map { "$matchpoint->{'index'}$phr=$_" } @source_keys ); >+ map { "$matchpoint->{'index'}$phr=\"$_\"" } @source_keys ); >+ #NOTE: double-quote the values so you don't get a "Embedded truncation not supported" error when a term has a ? in it. > } > > require C4::Search; >@@ -813,7 +814,7 @@ sub _get_match_keys { > } else { > foreach my $subfield ($field->subfields()) { > if (exists $component->{'subfields'}->{$subfield->[0]}) { >- $string .= " " . $subfield->[1]; >+ $string .= " " . $subfield->[1]; #FIXME: It would be better to create an array and join with a space later... > } > } > } >@@ -824,6 +825,7 @@ sub _get_match_keys { > $string= substr($string, $component->{'offset'}); > } > $key = $string; >+ $key =~ s/^\s+|\s+$//g; #Trim whitespace off the front and back of the key. > my $norms = $component->{'norms'}; > my $normalizer = $norms->[0]; #Matching rules, currently, can only have one normalizer. It will always be defined, even if it's only as ''. > if ($normalizer !~ /(none|raw)/i){ >-- >2.1.4
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 15745
:
47676
|
49255
|
49809