Bugzilla – Attachment 136750 Details for
Bug 26311
Add patron invalid age to search_for_data_inconsistencies.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26311: Add patron invalid age to search_for_data_inconsistencies.pl
Bug-26311-Add-patron-invalid-age-to-searchfordatai.patch (text/plain), 2.22 KB, created by
David Nind
on 2022-06-29 20:48:10 UTC
(
hide
)
Description:
Bug 26311: Add patron invalid age to search_for_data_inconsistencies.pl
Filename:
MIME Type:
Creator:
David Nind
Created:
2022-06-29 20:48:10 UTC
Size:
2.22 KB
patch
obsolete
>From 5c7cc4d2a6ee0bd3a9aa19594874dd4bb0501f73 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 27 Aug 2020 17:21:14 +0200 >Subject: [PATCH] Bug 26311: Add patron invalid age to > search_for_data_inconsistencies.pl > >Patron categories may have age limits. >Add to script misc/maintenance/search_for_data_inconsistencies.pl the list of patrons which age is invalid regarding there category. > >Test plan : >1) Create an adult patron category limited to 18-99 years >2) Create a patron in the category >3) Edit in database its date of birth so that he is 17 years old >4) Run misc/maintenance/search_for_data_inconsistencies.pl >=> You see the patron > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../search_for_data_inconsistencies.pl | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl >index 96b15f3264..e64758d1e2 100755 >--- a/misc/maintenance/search_for_data_inconsistencies.pl >+++ b/misc/maintenance/search_for_data_inconsistencies.pl >@@ -25,6 +25,7 @@ use Koha::BiblioFrameworks; > use Koha::Biblioitems; > use Koha::Items; > use Koha::ItemTypes; >+use Koha::Patrons; > use C4::Biblio qw( GetMarcFromKohaField ); > > { >@@ -276,6 +277,22 @@ use C4::Biblio qw( GetMarcFromKohaField ); > } > } > >+{ >+ my $patrons = Koha::Patrons->search( {}, { order_by => [ 'categorycode', 'borrowernumber' ] } ); >+ my @invalid_patrons; >+ while ( my $patron = $patrons->next ) { >+ push @invalid_patrons, $patron unless $patron->is_valid_age; >+ } >+ if (@invalid_patrons) { >+ new_section("Patrons with invalid age for category"); >+ foreach my $patron (@invalid_patrons) { >+ new_item( sprintf "Patron borrowernumber=%s in category '%s' has invalid age '%s'", >+ $patron->borrowernumber, $patron->category->categorycode, $patron->get_age ); >+ } >+ new_hint("You may change patron's category automatically with misc/cronjobs/update_patrons_category.pl"); >+ } >+} >+ > sub new_section { > my ( $name ) = @_; > say "\n== $name =="; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26311
:
109239
|
110106
|
110130
|
110131
|
110978
|
110979
|
110980
|
110998
|
128235
|
128236
|
128237
|
131295
|
131296
|
131297
|
132978
|
136665
|
136666
|
136667
|
136668
|
136750
|
136751
|
136752
|
136753
|
137039
|
137040
|
137041
|
137042
|
137043