Bugzilla – Attachment 111387 Details for
Bug 26518
Adding a record can succeed even if adding the biblioitem fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26518: Does not return from the catch block
Bug-26518-Does-not-return-from-the-catch-block.patch (text/plain), 1.56 KB, created by
Jonathan Druart
on 2020-10-09 08:26:35 UTC
(
hide
)
Description:
Bug 26518: Does not return from the catch block
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-10-09 08:26:35 UTC
Size:
1.56 KB
patch
obsolete
>From bf9e9e5f60780448892b1ec3f7ae7199e723c8ee Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26518
:
110902
|
110903
|
111387
|
111389
|
111512
|
111513
|
111514
|
111515
|
113046
|
113671
|
113672
|
113673
|
113674
|
113917
|
113918
|
113919
|
113920
|
113921