Bug 21150

Summary: Data inconsistencies - item types
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Command-line UtilitiesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, katrin.fischer, kohadevinim, martin.renvoize, mtj, nick, pasi.kallinen, robin
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20623
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20855
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4879
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21842
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22480
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 20509    
Bug Blocks: 21010, 21591    
Attachments: Bug 21150: Search for item types inconsistencies
Bug 21150: Search for item types inconsistencies
Bug 21150: add the biblionumber to the output
Bug 21150: add the biblionumber to the output
Bug 21150: Search for item types inconsistencies
Bug 21150: add the biblionumber to the output

Description Jonathan Druart 2018-08-02 15:24:38 UTC
We should test the item-level_itypes, biblioitems.itemtype, items.itype and the itemtypes table.
Comment 1 Katrin Fischer 2018-08-02 15:25:48 UTC
could we make the test on biblioitems.itemtype optional? We never set it (union catalog, can't save fields from being overwritten etc.)
Comment 2 Jonathan Druart 2018-08-02 15:36:52 UTC
The idea is:

1.
if item-level_itypes, then items.itype must be set
else biblioitems.itemtype must be set

2. item types defined in items and (or?) biblioitems must be defined in the itemtypes table

Does it make sense?
Comment 3 Katrin Fischer 2018-08-02 15:44:47 UTC
Yes, it does!
Comment 4 Jonathan Druart 2018-08-03 18:04:40 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2018-08-07 13:41:38 UTC
Created attachment 77523 [details] [review]
Bug 21150: Search for item types inconsistencies

search_for_data_inconsistencies.pl will now display errors if:
1.item-level_itypes is set to "specific item" and items.itype is not set
or not set to an item type defined in the system (itemtypes.itemtype)
2.item-level_itypes is set to "biblio record" and biblioitems.itemtype is not set
or not set to an item type defined in the system (itemtypes.itemtype)

Test plan:
Use the script and the different possible combinations to display the
errors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2018-08-07 13:43:30 UTC
This works well for me. Can I suggest an improvement? It would make it a lot easier to follow up on errors if the biblionumber was in the output too.
Comment 7 Jonathan Druart 2018-08-07 14:15:14 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2018-08-07 14:15:36 UTC
(In reply to Owen Leonard from comment #6)
> This works well for me. Can I suggest an improvement? It would make it a lot
> easier to follow up on errors if the biblionumber was in the output too.

Like what does this last patch?
Comment 9 Owen Leonard 2018-08-07 14:36:22 UTC
Created attachment 77537 [details] [review]
Bug 21150: add the biblionumber to the output

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 10 Katrin Fischer 2018-08-08 11:46:17 UTC
Created attachment 77562 [details] [review]
Bug 21150: Search for item types inconsistencies

search_for_data_inconsistencies.pl will now display errors if:
1.item-level_itypes is set to "specific item" and items.itype is not set
or not set to an item type defined in the system (itemtypes.itemtype)
2.item-level_itypes is set to "biblio record" and biblioitems.itemtype is not set
or not set to an item type defined in the system (itemtypes.itemtype)

Test plan:
Use the script and the different possible combinations to display the
errors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2018-08-08 11:46:21 UTC
Created attachment 77563 [details] [review]
Bug 21150: add the biblionumber to the output

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Nick Clemens (kidclamp) 2018-08-22 15:02:08 UTC
Awesome work all!

Pushed to master for 18.11
Comment 13 Martin Renvoize 2018-08-24 11:58:02 UTC
Enhancement pushed to 18.05.x for 18.05.03. 

As with bug 21011 this is a helpful enhancement for system administrators and has no negative (or visible effects) for the end users. Backported.
Comment 14 Fridolin Somers 2018-09-21 13:54:39 UTC
Pushed to 17.11.x for 17.11.10