Bug 21452 - Items available for hold or loan must have an item type
Summary: Items available for hold or loan must have an item type
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-28 19:36 UTC by Barton Chittenden
Modified: 2024-07-04 20:37 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2018-09-28 19:36:47 UTC
Because items may be created during cataloging or acquisitions before we know the item type, it's not practical to set a database constraint where items.itype is not NULL. However, if an item without an item type is checked out or a hold is placed on the item, either items.itype or biblioitems.itemtype (if we're using biblio level items) *must* be populated, or we'll trigger an internal server error.

We should be checking for this when we set the notforloan status.
Comment 1 Katrin Fischer 2018-09-30 12:16:19 UTC
If the problem is acq items, maybe setting the itemtype not-mandatory for the ACQ framework but mandatory for every other would work? There is a lot more things that influence if an item can be checked out, not only the not-for-loan status.
Comment 2 Barton Chittenden 2018-10-02 23:26:50 UTC
(In reply to Katrin Fischer from comment #1)
> If the problem is acq items, maybe setting the itemtype not-mandatory for
> the ACQ framework but mandatory for every other would work? There is a lot
> more things that influence if an item can be checked out, not only the
> not-for-loan status.

I'm not sure that will work:

1) If item-level_itypes is set to 'biblio record', items.itype may not be set at all, so we really need to test that one or the other is set.

2) Even if an item is in acquisitions, the library may want to the not-for-loan status to a negative number, making it available to be placed on hold... at that point, the item type needs to be set. That may well happen while the item is still in acquisitions.
Comment 3 Barton Chittenden 2018-10-02 23:27:48 UTC
Also, frameworks are editable, and I'd rather not have this be something that a user can disable.
Comment 4 Katrin Fischer 2023-10-07 22:55:40 UTC
We are now enforcing the itemtype to be mandatory.