Bug 31299: Fix duplicate output in search_for_data_inconsistencies.pl
authorFridolin Somers <fridolin.somers@biblibre.com>
Fri, 5 Aug 2022 18:36:50 +0000 (08:36 -1000)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 31 Oct 2022 22:00:28 +0000 (22:00 +0000)
commite731d4cff4f6653c6c3e48d1bef8940bff228e2a
tree5dd70c7fc4d7b63e14841f6a3b8c404287d6aa89
parent278cd8b827f13a68f3375f828483d40d5eaa7b31
Bug 31299: Fix duplicate output in search_for_data_inconsistencies.pl

In search_for_data_inconsistencies.pl when there are several inconsistencies on same framework, the second output of items contains the first one.

Looks like it is since Bug 21466

Test plan using koha-testing-docker :
1) Create 2 inconsistencies on the same item via SQL :
   update items set itemlost = 9 where itemnumber=900;
   update items set notforloan = 8 where itemnumber=900;
2) Without patch
3) Run ./misc/maintenance/search_for_data_inconsistencies.pl
=> You see duplicate output :
== Wrong values linked to authorised values ==
* The Framework *BKS* is using the authorised value's category *NOT_LOAN*, but the following items.notforloan do not have a value defined ({itemnumber => value }):
 {900 => 8}
* The Framework *BKS* is using the authorised value's category *LOST*, but the following items.itemlost do not have a value defined ({itemnumber => value }):
 {900 => 8} {900 => 9}

4) Apply patch
5) Run ./misc/maintenance/search_for_data_inconsistencies.pl
=> Fixed :D
== Wrong values linked to authorised values ==
* The Framework *BKS* is using the authorised value's category *LOST*, but the following items.itemlost do not have a value defined ({itemnumber => value }):
 {900 => 9}
* The Framework *BKS* is using the authorised value's category *NOT_LOAN*, but the following items.notforloan do not have a value defined ({itemnumber => value }):
 {900 => 8}

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3d0015fe6932f2fed3aba79b1fc99ecb6d1d3504)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
misc/maintenance/search_for_data_inconsistencies.pl