From 685fcb1880b5be44283620a0f7eacc3f2064680d 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 Signed-off-by: Lisette Scheer Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Jonathan Druart --- 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.39.5