Bugzilla – Attachment 120247 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.50 KB, created by
Lucas Gass
on 2021-04-27 21:27:19 UTC
(
hide
)
Description:
Bug 28241: Fix regex to allow for content before and after comma
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2021-04-27 21:27:19 UTC
Size:
1.50 KB
patch
obsolete
>From 82065f1770f689d7cd1e9805bce94e43d7983667 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 >--- > 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 a93bc19723..0f00e4db95 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -869,7 +869,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