From bf9e9e5f60780448892b1ec3f7ae7199e723c8ee Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Oct 2020 10:26:18 +0200 Subject: [PATCH] Bug 26518: Does not return from the catch block --- C4/Biblio.pm | 2 +- t/db_dependent/Biblio.t | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 36fea5e3ab..178aef0b14 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -299,7 +299,7 @@ sub AddBiblio { }); } catch { warn $_; - return (undef, undef); + ( $biblionumber, $biblioitemnumber ) = ( undef, undef ); }; return ( $biblionumber, $biblioitemnumber ); } diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 49331dc4b6..a3381bd71f 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -49,7 +49,6 @@ subtest 'AddBiblio' => sub { t::lib::Mocks::mock_preference( 'marcflavour', $marcflavour ); my $record = MARC::Record->new(); - warn Koha::Biblios->count; my ( $f, $sf ) = GetMarcFromKohaField('biblioitems.lccn'); my $lccn_field = MARC::Field->new( $f, ' ', ' ', $sf => 'ThisisgoingtobetoomanycharactersfortheLCCNfield' ); @@ -63,7 +62,7 @@ subtest 'AddBiblio' => sub { is( $biblioitemnumber, undef, 'AddBiblio returns undef for biblioitemnumber if something went wrong' ); - is( $nb_biblios, Koha::Biblios->count, + is( Koha::Biblios->count, $nb_biblios, 'No biblio should have been added if something went wrong' ); }; -- 2.20.1