Bug 31154: Pass biblionumber to Koha::UI::Form::Builder::Item->new from batchMod...
authorEmmi Takkinen <emmi.takkinen@koha-suomi.fi>
Tue, 26 Jul 2022 10:18:43 +0000 (13:18 +0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 16 Sep 2022 13:26:26 +0000 (10:26 -0300)
commit355ab980cc306a61e5e9e62608c5d9d1bf8e3b37
treea02266f8170dd97630928ca9df5f89bebe31ab22
parentf5b32eb5096858c38cb4104ed6e75f4c7fb3ad5a
Bug 31154: Pass biblionumber to Koha::UI::Form::Builder::Item->new from batchMod.pl to prevent error 500

When one tries to batch mod items and has "Use default values"
checkbox checked on and they have value in syspref "itemcallnumber",
Koha dies on error 500. In logs it reads:

Can't call method "field" on an undefined value at
.../Koha/Koha/UI/Form/Builder/Item.pm line 164.

This happens because in batchMod.pl line 269 we don't pass
biblionumber as parameter to Koha::UI::Form::Builder::Item->new
and thus Koha fails to fetch biblios marc record.

To test:
1. Confirm you have/set value to syspref "itemcallnumber" e.g. 084a
2. Find some item(s) to modify
3. Provide barcodes of those item(s) and check checkbox "Use default values"
4. Hit "Continue"
=> error 500 is raised
5. Apply patch.
6. Repeat steps 3. and 4.
=> no error is raised

Sponsored-by: Koha-Suomi Oy
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
tools/batchMod.pl