Bugzilla – Attachment 120712 Details for
Bug 28241
OPACNoResultsFound {QUERY_KW} placeholder doesn't always match the search terms when commas are included in the search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28241: Fix regex to allow for content before and after comma
Bug-28241-Fix-regex-to-allow-for-content-before-an.patch (text/plain), 1.62 KB, created by
Nick Clemens
on 2021-05-07 18:30:57 UTC
(
hide
)
Description:
Bug 28241: Fix regex to allow for content before and after comma
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-05-07 18:30:57 UTC
Size:
1.62 KB
patch
obsolete
>From 480cf51a063f77d0fbe8ea8617eb1e0ad2dc1a17 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 27 Apr 2021 21:23:55 +0000 >Subject: [PATCH] Bug 28241: Fix regex to allow for content before and after > comma > >1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder. >2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns. >3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'. >4. Apply patch >5. Try the search again, you should see the content before and after a comma > >Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > opac/opac-search.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 26ec1cca9e..878d97826f 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -902,7 +902,7 @@ for (my $i=0;$i<@servers;$i++) { > if ($nohits and $nohits=~/{QUERY_KW}/){ > # extracting keywords in case of relaunching search > (my $query_kw=$query_desc)=~s/ and|or / /g; >- my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g); >+ my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^:]|$)/g); > $query_kw=join('+',@query_kw); > $nohits=~s/{QUERY_KW}/$query_kw/g; > $template->param('OPACNoResultsFound' =>$nohits); >-- >2.11.0
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 28241
:
120247
|
120319
| 120712