Bug 16671: (bug 14828 follow-up) Pick the right itemtypes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 6 Jun 2016 13:00:56 +0000 (14:00 +0100)
committerFrédéric Demians <f.demians@tamil.fr>
Mon, 1 Aug 2016 08:36:42 +0000 (10:36 +0200)
commit4b2804dce136b88933240f607fe23f09137198f1
tree2578a7cc9e7759a3a22f9b3c518cc71734c59fd6
parent7c68f51d13499992c634775d5407ced89cc69a5b
Bug 16671: (bug 14828 follow-up) Pick the right itemtypes

Looking at commit aafe73eefb5151454fa8957bf188768324d23955
  Bug 14828: Use Koha::ItemType[s] everywhere C4::ItemType was used
-my @item_types = C4::ItemType->all;
-my @for_loan = grep { $_->{notforloan} == 0 } @item_types
-  or BAIL_OUT("No adequate itemtype");
-my $itemtype = $for_loan[0]->{itemtype};
+my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next;
+$itemtype or BAIL_OUT("No adequate itemtype"); #FIXME Should be $itemtype = $itemtype->itemtype

It seems that the tests expect itemtypes for loan.

Test plan:
  prove t/db_dependent/HoldsQueue.t
should still return green

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. No qa test tool errors

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Adding follow-up.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8f42c681b0208ace7ed7858cafdd8c9777debd96)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
t/db_dependent/HoldsQueue.t