Bug 10385 - item-level_itypes checks need to be refactored
Summary: item-level_itypes checks need to be refactored
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-31 17:19 UTC by Galen Charlton
Modified: 2021-10-08 10:59 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-05-31 17:19:05 UTC
Checks on the item-level_itypes system preference are scattered throughout the code, and there have been a large number of bugs concerning cases where such a check is missing.

I propose checks of this system preference be moved as far down the stack as possible.  Specifically, all routines that fetch items from the database should check the syspref to determine the correct item type column and return it via (say) an "item_type" key in the response, to distinguish it from 'itemtype' and 'itype'.  The only code that would see 'itype' or 'itemtype' would be code directly related to modifying items.  Further, the syspref would be checked in as few places as possible.

I further propose pinning down the semantics of the item-level_itypes as follows:

- when ON, the item type is *always* taken from items.itype for all display and circulation purposes
- when OFF, the item type is *always* taken from biblioitems.itemtype

In particular, the current behavior of GetItem (fetch the itype from the item if it's not blank, otherwise fall back to the biblioitem itemtype), would be modified.

Related bugs include:

- Bug 7491
- Bug 7492
Comment 1 Katrin Fischer 2013-06-04 06:30:26 UTC
I think there has been some work to make use of the biblio level itemtype for display in the result lists even when item level itemtypes are being used. So I am not sure it will work for everyone to only use the itype from the level set in the system preference. Maybe we could return 3 values? Both itemtypes for biblio and item level and the one to be used for circulation logic?

As our libraries participate in a union catalog where the records are imported/updated automatically into Koha, we don't set bilbio level itemtypes at all.
Comment 2 Galen Charlton 2013-06-04 15:11:48 UTC
In light of that... how about no syspref at all?

What I mean is that we make *both* biblio- and item-level item types visible.  For the sake of clarity, I'll call the biblo-level ones "material types".

For circulation rules, *both* the item type and the material type could be taken into account by adding a material type column to issuingrules (and on upgrade, populating it based on the value of the syspref).

For OPAC display, allow icons to be associated with both material types and item types.
Comment 3 Marcel de Rooy 2021-10-08 10:58:34 UTC
I would love to change this title to : item-level_itype checks need to be removed