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 <martin.renvoize@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-05-11 16:47:59 +01:00 committed by Tomas Cohen Arazi
parent de4fcc91f0
commit be3bd8af8b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -344,7 +344,7 @@ UI.
sub table_name_fixer { sub table_name_fixer {
my ( $self, $q ) = @_; my ( $self, $q ) = @_;
$q =~ s|biblio\.|biblio\.biblioitem\.|g $q =~ s{biblio\.(?=isbn|ean|publisher)}{biblio\.biblioitem\.}g
if $q =~ m/.*(isbn|ean|publisher).*/; if $q =~ m/.*(isbn|ean|publisher).*/;
return $q; return $q;