[Bug 29106] New: Can we get rid of Koha::Item->effective_itemtype
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 Bug ID: 29106 Summary: Can we get rid of Koha::Item->effective_itemtype Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org I file this bug to gather some ideas. Do we still need that pattern here? Right now we send a warning to the logs each time an item doesn't have an item type set. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, | |katrin.fischer@bsz-bw.de, | |kyle@bywatersolutions.com, | |m.de.rooy@rijksmuseum.nl, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- sub effective_itemtype { my ( $self ) = @_; my $pref = C4::Context->preference('item-level_itypes'); if ( $pref && $self->itype() ) { return $self->itype(); } else { warn "item-level_itypes set but no itemtype set for item (".$self->itemnumber.")" if $pref; return $self->biblioitemnumber()->itemtype(); } } This sub c/should be moved out of the DBIx schema file to Koha::Item ? There is no need to warn each time imo. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #1)
sub effective_itemtype { my ( $self ) = @_;
my $pref = C4::Context->preference('item-level_itypes'); if ( $pref && $self->itype() ) { return $self->itype(); } else { warn "item-level_itypes set but no itemtype set for item (".$self->itemnumber.")" if $pref; return $self->biblioitemnumber()->itemtype(); } }
This sub c/should be moved out of the DBIx schema file to Koha::Item ? There is no need to warn each time imo.
I think it should be moved to the object. That method was added to the DBIC class before Koha::Object(s) existed! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- When I said we send a warning to the logs, I meant we are telling the users their data is wrong. It implies that the user needs to fix that. Implicitly, we are telling people they need to set a value there. Can't we force that somehow? And set the 'effective item type' on a DBRev instead? It feels like it was a trasitional step, for a transition that never took place. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to Tomás Cohen Arazi from comment #3)
When I said we send a warning to the logs, I meant we are telling the users their data is wrong. It implies that the user needs to fix that. Implicitly, we are telling people they need to set a value there.
Can't we force that somehow? And set the 'effective item type' on a DBRev instead? It feels like it was a trasitional step, for a transition that never took place.
It would be better to have a Koha data linter tool for sure. Maybe we should move this check to the about page, considering we have other checks of this nature there. The reason the warning is there is because itemtype is required for Koha to operate correctly. It can be set at either the item or the bib level. That's why that warning ended up where it is. However, unless somebody is routinely combing through the logs that warning will go unnoticed. It seems more sensible to remove the warning there and add a check to the about page. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- IIRC items without itemtype come from Acquisition -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Marcel de Rooy from comment #5)
IIRC items without itemtype come from Acquisition
Yes, they often do. And they won't cause an issue until you try to check them out. We have moved to setting itemtype mandatory for items in our libraries to avoid this from happening - at least on the non-ACQ frameworks. I am not sure about the consequences of removing the warn - so not going to comment on that. But having a way to tell users that their data needs fixing is probably a good thing, given that Koha explodes badly when those items slip through in some areas. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Katrin Fischer from comment #6)
I am not sure about the consequences of removing the warn - so not going to comment on that. But having a way to tell users that their data needs fixing is probably a good thing, given that Koha explodes badly when those items slip through in some areas.
misc/maintenance/search_for_data_inconsistencies.pl is catching that. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- If you want to get rid of this method you should get rid of item-level_itypes first :D Long standing discussion https://lists.koha-community.org/pipermail/koha-devel/2015-December/042114.h... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #8)
If you want to get rid of this method you should get rid of item-level_itypes first :D
Long standing discussion https://lists.koha-community.org/pipermail/koha-devel/2015-December/042114. html
Yes, long standing :) I am for killing the system preference, but we do require teh item type on record level for a number of features by now, so not sure we could get rid of all the effective itemtype handling. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- The idea was to have biblioitems.itemtype always populated and accurate (done when upgrading and when a new item is created). No need to check anything else. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure we can have it always accurate - I know libraries use this a lot for records without items (articles, electronic resources, series records, set records, etc.), so manual interaction will always be required there to make it accurate. We could add an automatism to update the record level itemtype when all items have the same itemtype - but this might not be what some libraries want (it would fit ours). But if the itemtypes for the items are different, this would not work. Use case in academics: one item has a not for loan item type to always remain in the library for reference, while additional copies can be checked out I think especially in some French/UNIMARC libraries, there were different authorised valued used for bibioitems (document type) and items - something we would need to clarify is not an intended workflow and maybe help provide workarounds for. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hm adding to that: as long we can't "save" 942$c from being overwritten by the import, enforcing the itemtype on record level is quite an unsolvable issue for us. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> ---
misc/maintenance/search_for_data_inconsistencies.pl is catching that.
I know, but I think we need something more low level, that doesn't require server side interaction for libraries. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- HEA figures for item-level_itypes show that there is a very convincing number of libraries to remove the pref. 28 NULL 16 (empty?) 239 0 11386 1 Btw the discussion for an default itemtype might be a topic on itself? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29106 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Bug 10385 ? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org