From 82065f1770f689d7cd1e9805bce94e43d7983667 Mon Sep 17 00:00:00 2001 From: Lucas Gass 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