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
Created attachment 138713 [details] [review] 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}
This can generate some huge outputs ^^
Created attachment 140700 [details] [review] 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>
Trivial; SO+QA
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for upcoming 22.05.07 release
applied to 21.11 for 21.11.14
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.