Bug 21466 - Data inconsistencies - koha fields linked to AV cat values must have a corresponding authorised value
Summary: Data inconsistencies - koha fields linked to AV cat values must have a corres...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: additional_work_needed
Depends on:
Blocks: 21010 18355
  Show dependency treegraph
 
Reported: 2018-10-01 21:31 UTC by Jonathan Druart
Modified: 2020-06-04 20:38 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00


Attachments
Bug 21466: Search for items.location inconsistencies (2.86 KB, patch)
2018-10-17 18:09 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21466: Catch any values that should be defined in the AV but are not (4.34 KB, patch)
2019-03-05 20:08 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21466: Search for items.location inconsistencies (2.96 KB, patch)
2019-11-25 09:47 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21466: Catch any values that should be defined in the AV but are not (4.40 KB, patch)
2019-11-25 09:47 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21466: Keep all AVs for a given framework (5.29 KB, patch)
2020-01-29 11:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21466: Keep all AVs for a given framework (5.29 KB, patch)
2020-01-29 11:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21466: Keep all AVs for a given framework (5.35 KB, patch)
2020-02-04 13:31 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-10-01 21:31:39 UTC
See bug 18355.
Comment 1 Jonathan Druart 2018-10-01 21:50:23 UTC
(In reply to Katrin Fischer from bug 21010 comment #6)
> (In reply to Jonathan Druart from bug 21010 comment #5)
> > Bug 21466 - Data inconsistencies - items.location values must have a
> > corresponding authorised value
> 
> What if they are not mapped to LOC? I think I remember patches to display as
> is in this case a while ago (Biblibre?)

The mapping for items.location, depending on the framework, must be used.
Comment 2 Jonathan Druart 2018-10-17 18:09:19 UTC
Created attachment 80746 [details] [review]
Bug 21466: Search for items.location inconsistencies
Comment 3 Jonathan Druart 2018-10-17 18:13:15 UTC
I am wondering if we should not be more generic and search for any item's attribute that is mapped to a koha field, linked to an authorised value category but without a corresponding value.

That would catch itemlost, damaged, notforloan, restricted, etc. as well
Comment 4 Katrin Fischer 2018-10-28 18:04:29 UTC
(In reply to Jonathan Druart from comment #3)
> I am wondering if we should not be more generic and search for any item's
> attribute that is mapped to a koha field, linked to an authorised value
> category but without a corresponding value.
> 
> That would catch itemlost, damaged, notforloan, restricted, etc. as well

Sounds good to me. We probably would have to check the frameworks too?
Comment 5 Jonathan Druart 2019-03-05 20:08:21 UTC
Created attachment 86118 [details] [review]
Bug 21466: Catch any values that should be defined in the AV but are not

Let's expand the idea of the first patch to catch the wrong values for
any others AV.
Comment 6 Martin Renvoize 2019-11-25 09:47:44 UTC
Created attachment 95773 [details] [review]
Bug 21466: Search for items.location inconsistencies

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2019-11-25 09:47:47 UTC
Created attachment 95774 [details] [review]
Bug 21466: Catch any values that should be defined in the AV but are not

Let's expand the idea of the first patch to catch the wrong values for
any others AV.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2019-11-25 09:48:53 UTC
Works as expected and it a useful addition.. Signing off
Comment 9 Martin Renvoize 2019-11-28 12:39:08 UTC
It would be good to get this into 19.11.01, it sohuld have been in .00 really, but it got stuck awaiting QA
Comment 10 Martin Renvoize 2020-01-13 13:56:02 UTC
This has languished long enough.. Passing QA.
Comment 11 Martin Renvoize 2020-01-13 13:58:54 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 12 Jonathan Druart 2020-01-29 11:39:36 UTC
I found a bug in this one. I am working on it.
Comment 13 Jonathan Druart 2020-01-29 11:48:00 UTC
Created attachment 98062 [details] [review]
Bug 21466: Keep all AVs for a given framework

There was a major (and silly) issue in the previous version, only one AV
was kept as we erased the hash value at the end of each iteration:
$invalid_locations_per_framework->{$framework->frameworkcode } =
  { items => $items, av_category => $mss->authorised_value, kohafield => $kohafield };
Comment 14 Jonathan Druart 2020-01-29 11:59:35 UTC
Created attachment 98063 [details] [review]
Bug 21466: Keep all AVs for a given framework

There was a major (and silly) issue in the previous version, only one AV
was kept as we erased the hash value at the end of each iteration:
$invalid_locations_per_framework->{$framework->frameworkcode } =
  { items => $items, av_category => $mss->authorised_value, kohafield => $kohafield };
Comment 15 Jonathan Druart 2020-01-29 13:22:09 UTC
See also https://gitlab.com/koha-community/koha-misc4dev/-/merge_requests/36
Comment 16 Jonathan Druart 2020-01-29 13:22:40 UTC
I think it's ready now, but I'd like a QA review on the last patch.
Comment 17 Martin Renvoize 2020-02-04 13:31:29 UTC
Created attachment 98389 [details] [review]
Bug 21466: Keep all AVs for a given framework

There was a major (and silly) issue in the previous version, only one AV
was kept as we erased the hash value at the end of each iteration:
$invalid_locations_per_framework->{$framework->frameworkcode } =
  { items => $items, av_category => $mss->authorised_value, kohafield => $kohafield };

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize 2020-02-04 13:32:17 UTC
OK, Tested thoroughly here.. looks good...

Thanks Jonathan, passing QA
Comment 19 Martin Renvoize 2020-02-04 13:39:15 UTC
Nice work everyone!

Pushed to master for 20.05