From 08a86c233576323f3d347a43690124c6fc8a0073 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Jul 2019 12:37:42 +0100 Subject: [PATCH] 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 --- t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3a89ba1330..99dacec4dd 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'; -- 2.39.5