Somehow an imported item had no itemtype (might be another bug btw), but anyway it results in a never ending loading of checkouts since svc/checkouts crashes. Resolved by a simple test. item-level_itypes set but no itemtype set for item (451) at /usr/share/koha/masterclone/Koha/Schema/Result/Item.pm line 698. Can't call method "translated_description" on an undefined value at /usr/share/koha/masterclone/svc/checkouts line 168.
Created attachment 68250 [details] [review] Bug 19484: Add test before using object itemtype Resolves this crash: item-level_itypes set but no itemtype set for item (451) at /usr/share/koha/masterclone/Koha/Schema/Result/Item.pm line 698. Can't call method "translated_description" on an undefined value at /usr/share/koha/masterclone/svc/checkouts line 168. Test plan: [1] Create/update an item so that it has itemtype NULL. [2] Check it out on Circulation page. Before this patch the loading would never stop. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Since itype is not a foreign key, it would also work to put say BKS into itype when you only have BK in your item types. (Update via mysql.)
Since importing unknown itemtypes is possible, I am wondering what the severity of this bug should be btw..
Created attachment 68285 [details] [review] Bug 19484: Add test before using object itemtype Patch applies and functions as described. I agree with you that importing NULL itemtypes is possible Marcel. A higher importance level makes sense. Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au>
(In reply to Dilan Johnpullé from comment #4) > Created attachment 68285 [details] [review] [review] > Bug 19484: Add test before using object itemtype > > Patch applies and functions as described. I agree with you that importing > NULL itemtypes is possible Marcel. A higher importance level makes sense. > > Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> Thanks
Created attachment 68703 [details] [review] Bug 19484: Add test before using object itemtype Patch applies and functions as described. I agree with you that importing NULL itemtypes is possible Marcel. A higher importance level makes sense. Signed-off-by: Dilan Johnpullé <dilan@calyx.net.au> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
There was a thread on the ML: http://lists.koha-community.org/pipermail/koha-devel/2017-July/043841.html "Expected behaviour if itemtype does not exist" The correct solution would be to provide a script to make sure the data are correct and/or display a warning message on the about page.
Pushed to master for 17.11, thanks to everybody involved!