C4::Reserves::IsAvailableForItemLevelRequest my $itemtype = $item->effective_itemtype; my $notforloan_per_itemtype = Koha::ItemTypes->find($itemtype)->notforloan; If you have set item level itypes to biblioitems, but your biblioitem record has itemtype NULL, placing a hold will crash. (You must have an item too.)
Created attachment 127925 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 128122 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
(In reply to Thibaud Guillot from comment #2) > Created attachment 128122 [details] [review] [review] > Bug 29553: Fix crash on undefined notforloan value > > Test plan: > Set item level itypes to biblioitems. > Find a record with itemtype NULL, having an item. > Place a hold. Without this patch, it crashes. > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> Thx Thibaud. I will adjust the patch status accordingly.
Created attachment 128681 [details] [review] Bug 29553: Fix crash on undefined notforloan value Test plan: Set item level itypes to biblioitems. Find a record with itemtype NULL, having an item. Place a hold. Without this patch, it crashes. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 128682 [details] [review] Bug 29553: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 128683 [details] [review] Bug 29553: (QA follow-up) Check defined instead of evaluating as boolean Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.02
Pushed to 21.05.x for 21.05.09
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.