Bug 40555 - Items with empty itemtype causes Preservation module to crash
Summary: Items with empty itemtype causes Preservation module to crash
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-30 14:26 UTC by Pedro Amorim
Modified: 2025-07-31 09:43 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function: Bookings


Attachments
Bug 40555: Consider possibility of item not having itemtype on effective_bookable (774 bytes, patch)
2025-07-30 14:34 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-07-30 14:26:41 UTC
We've hit this recently on our demo installation, but I believe we've stumbled upon this in the past in different parts of Koha that may interact with Items (and Bookings, by extension).
Comment 1 Pedro Amorim 2025-07-30 14:32:02 UTC
The error log message is the following:

GET /api/v1/preservation/waiting-list/items: unhandled exception (Mojo::Exception)<<Can't call method "bookable" on an undefined value at /usr/share/koha/lib/Koha/Item.pm line 1929.>>

Produced when accessing:

<staff_url>/cgi-bin/koha/preservation/waiting-list

With one or more (?) items without an itemtype (or itype, depending on preference?) More analysis required.
Comment 2 Pedro Amorim 2025-07-30 14:34:20 UTC
Created attachment 184897 [details] [review]
Bug 40555: Consider possibility of item not having itemtype on effective_bookable
Comment 3 Jonathan Druart 2025-07-31 09:43:16 UTC
IMO This is invalid. We have discussed on bug 33166 (and others) and decided that we should not deal with corrupted data.

The bug here is to have the column null at the DB level.