From 22674a7ddfd986e80c7e65c9843f17b610cdcb11 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 8 Aug 2023 21:44:24 -1000 Subject: [PATCH] Bug 34505: Patron invalid age in search_for_data_inconsistencies.pl skip expired patrons Bug 26311 added patron invalid age in search_for_data_inconsistencies.pl But this is not relevant for expired patrons, especially in child categories. Check should skip expired patrons 1) Set a non-expired patron with invalid age 2) Run misc/maintenance/search_for_data_inconsistencies.pl => Check you see the patron 3) Edit patron to be expired 4) Run misc/maintenance/search_for_data_inconsistencies.pl => Check you do not see the patron Signed-off-by: Caroline Cyr La Rose Signed-off-by: Marcel de Rooy [EDIT] If we do not want to test valid age for expired patrons, you should obviously test expired first. Reversing the order in the test. Putting it in the search criteria would be nicer but leads to more complicated code. Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c26dff61e729df5c782840dfe29f032c83e0e14b) Signed-off-by: Fridolin Somers --- misc/maintenance/search_for_data_inconsistencies.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl index 4fd9502c36..ddc6b457dd 100755 --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ b/misc/maintenance/search_for_data_inconsistencies.pl @@ -310,7 +310,7 @@ use C4::Biblio qw( GetMarcFromKohaField ); ); my @invalid_patrons; while ( my $aging_patron = $aging_patrons->next ) { - push @invalid_patrons, $aging_patron unless $aging_patron->is_valid_age; + push @invalid_patrons, $aging_patron unless $aging_patron->is_expired || $aging_patron->is_valid_age; } if (@invalid_patrons) { new_section("Patrons with invalid age for category"); -- 2.39.5