From 2e17e39c0f56cf4649d1e39e17568e0a83151e13 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 7 Mar 2023 20:05:36 +0000 Subject: [PATCH] Bug 33100: Remove all punctuation at end of record This could potentially be overkill - if you have two records that only differ in ending punctuation, you might get a false result - I don't know how likely that is ( as I have mentioned before '!!!' is a band ) This seems a reasonable fix To test: 1 - Set sysprefs as in bug 33159 2 - Edit a record, biblionumebr 3 is fine 3 - Add a comma to end of author subfield a 4 - Save and note relinked 5 - Apply patch, restart all 6 - Save again 7 - Linked to original record Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 928a4cb465d7891157b1b061d144db6a808ada14) Signed-off-by: Matt Blenkinsop (cherry picked from commit c2f2c68a07a21f6fefd3be4682f9acd5405b5f5b) Signed-off-by: Lucas Gass (cherry picked from commit 37f4355e432dea8e9a88f221388324a2fa48f754) Signed-off-by: Arthur Suzuki --- C4/Heading/MARC21.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Heading/MARC21.pm b/C4/Heading/MARC21.pm index 011d16268c..06ea634a86 100644 --- a/C4/Heading/MARC21.pm +++ b/C4/Heading/MARC21.pm @@ -404,7 +404,7 @@ sub _get_search_heading { my $code = $subfields[$i]->[0]; my $code_re = quotemeta $code; my $value = $subfields[$i]->[1]; - $value =~ s/[\s]*[-,.:=;!%\/][\s]*$//; + $value =~ s/[\s]*[-,.:=;!%\/]*[\s]*$//; next unless $subfields =~ qr/$code_re/; if ($first) { $first = 0; -- 2.39.5