Bug 23404: fix Circulation::TooMany error on itemtype when at biblio level
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 31 Jul 2019 13:56:22 +0000 (15:56 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 9 Sep 2019 10:14:08 +0000 (11:14 +0100)
commit9e1fa801d6f1ff718d8689c855483b8b9c735a9f
treeb1a6d9ae56aaa826e8cd9752709621c8dbd064ed
parent445b0cb8b595136afdebaee2db3bc768b42b445b
Bug 23404: fix Circulation::TooMany error on itemtype when at biblio level

Circulation::TooMany gets itemtype from $item var beeing a Koha::Item unblessed.
When itemtype is at biblio level, calling $item->{'itemtype'} is wrong.

Test plan :
1) On a catalog with itemtype at item level : pref item-level_itypes=1
2) Create a biblio record with itemtype BOOK
3) Create an item on this biblio record with itemtype BOOK
4) Delete all issuing rules
5) Create a issuing rule with itemtype BOOK, any catagorie, any branch
6) Check-out the item
7) => Checkout is allowed
8) Check-in item
9) Change itemtype at biblio level : pref item-level_itypes=0
10) Check-out the item
11) => Checkout is not allowed
    You see message "No circulation rule is defined for this patron and itemtype combination"

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Circulation.pm