From 46a995784039c5d6727dd2169c6085634b134c4e 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 Content-Type: text/plain; charset=utf-8 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 --- 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; -- 2.20.1