[Bug 21591] New: Data inconsistencies - Item types and biblio level
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Bug ID: 21591 Summary: Data inconsistencies - Item types and biblio level Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz bug 21150 added a script to check for missing item level itemtypes - it doesn't like when both the item and the record are missing itemtype -- 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=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=21591 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 80757 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=80757&action=edit Bug 21591: Check for record level item type issues too To test: 1 - sudo koha-mysql kohadev 2 - UPDATE biblioitems SET itemtype = NULL where biblionumber = 1 3 - UPDATE items SET itype = NULL where biblionumber = 1 4 - perl misc/maintenance/search_for_data_inconsistencies.pl 5 - Notice warnings 6 - Apply patch 7 - Undefined itemtype on bibliolevel is now warned -- 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=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- 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=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21150 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21150 [Bug 21150] Data inconsistencies - item types -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- What about NULL vs ''? I think we should alert if '', do not you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Could we make the warn on missing biblio-level optional? For us it's normal that there is only an itemtype on item level. We are aware it can be an issue, but it's currently not possible to change it easily because of our union catalog model. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- IMO we should not hide/skip something in this script. We display possible issues, if you are aware of them you can just ignore it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #2)
What about NULL vs ''?
I think we should alert if '', do not you think?
Failing QA to get an answer ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 88377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88377&action=edit Bug 21591: Additionally check for blank strings in itypes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 88377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88377 Bug 21591: Additionally check for blank strings in itypes Review of attachment 88377: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21591&attachment=88377) ----------------------------------------------------------------- ::: C4/Reserves.pm @@ +330,4 @@
# Check for item on shelves and OnShelfHoldsAllowed return { status => 'onShelfHoldsNotAllowed' } + unless ( IsAvailableForItemLevelRequest($item->unblessed,$borrower) );
Is that change correct? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |david@davidnind.com --- Comment #8 from David Nind <david@davidnind.com> --- Patch no longer applies: root@333442e28e76:koha(21591)$ git bz apply 21591 Bug 21591 - Data inconsistencies - Item types and biblio level 80757 - Bug 21591: Check for record level item type issues too 88377 - Bug 21591: Additionally check for blank strings in itypes Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 21591: Check for record level item type issues too Applying: Bug 21591: Additionally check for blank strings in itypes error: sha1 information is lacking or useless (C4/Reserves.pm). error: could not build fake ancestor Patch failed at 0001 Bug 21591: Additionally check for blank strings in itypes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #80757|0 |1 is obsolete| | Attachment #88377|0 |1 is obsolete| | --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 99920 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99920&action=edit Bug 21591: Check for record level item type issues too To test: 1 - sudo koha-mysql kohadev 2 - UPDATE biblioitems SET itemtype = NULL where biblionumber = 1 3 - UPDATE items SET itype = NULL where biblionumber = 1 4 - perl misc/maintenance/search_for_data_inconsistencies.pl 5 - Notice warnings 6 - Apply patch 7 - Undefined itemtype on bibliolevel is now warned 7 - Test also with itype="" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99920|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 99980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99980&action=edit Bug 21591: Check for record level item type issues too To test: 1 - sudo koha-mysql kohadev 2 - UPDATE biblioitems SET itemtype = NULL where biblionumber = 1 3 - UPDATE items SET itype = NULL where biblionumber = 1 4 - perl misc/maintenance/search_for_data_inconsistencies.pl 5 - Notice warnings 6 - Apply patch 7 - Undefined itemtype on bibliolevel is now warned 7 - Test also with itype="" Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #11 from David Nind <david@davidnind.com> --- Notes from testing: Warnings before patch applied ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ == Items do not have itype defined == Use of uninitialized value in sprintf at misc/maintenancesearch_for_data_inconsistencies.pl line 61. * Item with itemnumber=1 does not have a itype value, biblio's item type will be used () => The system preference item-level_itypes expects item types to be defined at item level Warning after patch applied (also tested itype=""): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ == Items do not have itype defined == * Item with itemnumber=1 does not have a itype value, additionally no item type defined for biblionumber=1 => The system preference item-level_itypes expects item types to be defined at item level -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 99980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99980 Bug 21591: Check for record level item type issues too Review of attachment 99980: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21591&attachment=99980) ----------------------------------------------------------------- ::: misc/maintenance/search_for_data_inconsistencies.pl @@ +89,4 @@
my @itemtypes = Koha::ItemTypes->search->get_column('itemtype'); if ( C4::Context->preference('item-level_itypes') ) { + my $items_with_invalid_itype = Koha::Items->search( { -and => [itype => { not_in => \@itemtypes }, itype => { '!=' => '' }] } );
I do not think we need that change. @itemtypes contains the values from the itemtypes table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #12)
Comment on attachment 99980 [details] [review] Bug 21591: Check for record level item type issues too
Review of attachment 99980 [details] [review]: -----------------------------------------------------------------
::: misc/maintenance/search_for_data_inconsistencies.pl @@ +89,4 @@
my @itemtypes = Koha::ItemTypes->search->get_column('itemtype'); if ( C4::Context->preference('item-level_itypes') ) { + my $items_with_invalid_itype = Koha::Items->search( { -and => [itype => { not_in => \@itemtypes }, itype => { '!=' => '' }] } );
I do not think we need that change. @itemtypes contains the values from the itemtypes table.
I see what I did here, I add the check for "" to the check for 'Items do not have itype defined' I considered a blank string to be 'unset' and so report in that section rather than in 'invalid' section -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99980|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 105180 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=105180&action=edit Bug 21591: Check for record level item type issues too To test: 1 - sudo koha-mysql kohadev 2 - UPDATE biblioitems SET itemtype = NULL where biblionumber = 1 3 - UPDATE items SET itype = NULL where biblionumber = 1 4 - perl misc/maintenance/search_for_data_inconsistencies.pl 5 - Notice warnings 6 - Apply patch 7 - Undefined itemtype on bibliolevel is now warned 7 - Test also with itype="" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00 |20.11.00, 20.05.01 released in| | CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- enhancement, not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21591 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |When an item does not have release notes| |an itemtype and the record | |(biblioitem) also has no | |itemtype defined the data | |inconsistencies script | |would error rather than | |reporting. | | | |We add a test | |for missing record level | |itemtypes so that we can | |correctly report these | |problems too. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org