From cb7b9b37c9908a88d7e1d2bb769c1ae89f36099d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 18 Nov 2022 14:41:51 +0100 Subject: [PATCH] Bug 32268: Prevent XSLT.t to fail randomly Can't call method "itemnumber" on an undefined value at /kohadevbox/koha/Koha/Recall.pm line 343. We should set item_level and not let TestBuilder pick a value. This may have been caught (make it more obvious) by the recent change to TestBuilder for boolean (Bug 32030: fix test builder for boolean) Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/XSLT.t | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index 314996d488..c4013aed2f 100755 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -133,11 +133,17 @@ subtest 'buildKohaItemsNamespace status tests' => sub { like($xml,qr{${library_name}}, "Found resultbranch / holding branch" ); t::lib::Mocks::mock_preference('UseRecalls', 1); - my $recall = $builder->build_object({ class => 'Koha::Recalls', value => { - biblio_id => $item->biblionumber, - item_id => $item->itemnumber, - pickup_library_id => $item->holdingbranch, - }}); + my $recall = $builder->build_object( + { + class => 'Koha::Recalls', + value => { + biblio_id => $item->biblionumber, + item_id => $item->itemnumber, + pickup_library_id => $item->holdingbranch, + item_level => 1, + } + } + ); $recall->set_waiting; $xml = C4::XSLT::buildKohaItemsNamespace( $item->biblionumber,[]); like($xml,qr{Recall waiting},"Waiting status takes precedence over In transit (recalls)"); -- 2.39.5