From be3bd8af8b1f2dbff33d2228eb64fa77fe9362f7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 11 May 2022 16:47:59 +0100 Subject: [PATCH] Bug 30677: Use lookahead in regex for biblioitem replacement This patch takes Andrew's suggested fix using a lookahead regex to correct our biblio vs biblioitem table name replacements. Please use the preceeding unit test patch proposed by Jonathan to test. Signed-off-by: Martin Renvoize Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- Koha/REST/V1/Acquisitions/Orders.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm index c91353a070..1ed0243e3d 100644 --- a/Koha/REST/V1/Acquisitions/Orders.pm +++ b/Koha/REST/V1/Acquisitions/Orders.pm @@ -344,7 +344,7 @@ UI. sub table_name_fixer { my ( $self, $q ) = @_; - $q =~ s|biblio\.|biblio\.biblioitem\.|g + $q =~ s{biblio\.(?=isbn|ean|publisher)}{biblio\.biblioitem\.}g if $q =~ m/.*(isbn|ean|publisher).*/; return $q;