From: Martin Renvoize Date: Mon, 15 Jul 2019 11:37:42 +0000 (+0100) Subject: Bug 22709: (RM follow-up) AddBiblio returns a list not a scalar X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=08a86c233576323f3d347a43690124c6fc8a0073 Bug 22709: (RM follow-up) AddBiblio returns a list not a scalar AddBiblio was being called in scalar context in Biblio_and_Items_plugin_hooks.t and this was leading to difficult to reproduce test failures. If the tests was run after any other test that also called AddBiblio then it would fail, but if it was run as the first test it would pass. This is due to a fluke in processing which meant the the final return value of the list (itemnumber) happened to match a biblionumber. Signed-off-by: Martin Renvoize --- diff --git a/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t b/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t index 3a89ba1..99dacec 100755 --- a/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t +++ b/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t @@ -55,7 +55,7 @@ subtest 'after_biblio_action() and after_item_action() hooks tests' => sub { my $biblio_id; - warning_like { $biblio_id = C4::Biblio::AddBiblio( MARC::Record->new(), '' ); } + warning_like { ( $biblio_id, undef ) = C4::Biblio::AddBiblio( MARC::Record->new(), '' ); } qr/after_biblio_action called with action: create, ref: Koha::Biblio/, 'AddBiblio calls the hook with action=create';