Bugzilla – Attachment 119463 Details for
Bug 21549
Lock expired patron accounts after x days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21549: Rename filter_by_dateexpiry with filter_by_expiration_date
Bug-21549-Rename-filterbydateexpiry-with-filterbye.patch (text/plain), 3.27 KB, created by
Jonathan Druart
on 2021-04-12 14:23:57 UTC
(
hide
)
Description:
Bug 21549: Rename filter_by_dateexpiry with filter_by_expiration_date
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-12 14:23:57 UTC
Size:
3.27 KB
patch
obsolete
>From 6259e3e9020ba9eb22046155029914df9f7be415 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 12 Apr 2021 16:12:50 +0200 >Subject: [PATCH] Bug 21549: Rename filter_by_dateexpiry with > filter_by_expiration_date > >--- > Koha/Patrons.pm | 6 +++--- > misc/cronjobs/cleanup_database.pl | 2 +- > t/db_dependent/Koha/Patrons.t | 10 +++++----- > 3 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index d42f035e4ca..616fefacbae 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -233,15 +233,15 @@ sub delete { > return $patrons_deleted; > } > >-=head3 filter_by_dateexpiry >+=head3 filter_by_expiration_date > >- Koha::Patrons->filter_by_dateexpiry{{ days => $x }); >+ Koha::Patrons->filter_by_expiration_date{{ days => $x }); > > Returns set of Koha patron objects expired $x days. > > =cut > >-sub filter_by_dateexpiry { >+sub filter_by_expiration_date { > my ( $class, $params ) = @_; > > return $class->filter_by_last_update( >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index c4a86d18555..4f56e9b4d33 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -405,7 +405,7 @@ if($allDebarments) { > # Lock expired patrons? > if( defined $lock_days && $lock_days ne q{} ) { > say "Start locking expired patrons" if $verbose; >- my $expired_patrons = Koha::Patrons->filter_by_dateexpiry({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } }); >+ my $expired_patrons = Koha::Patrons->filter_by_expiration_date({ days => $lock_days })->search({ login_attempts => { '!=' => -1 } }); > my $count = $expired_patrons->count; > $expired_patrons->lock({ remove => 1 }) if $confirm; > if( $verbose ) { >diff --git a/t/db_dependent/Koha/Patrons.t b/t/db_dependent/Koha/Patrons.t >index 6f03a9c9d39..e2bc7366658 100755 >--- a/t/db_dependent/Koha/Patrons.t >+++ b/t/db_dependent/Koha/Patrons.t >@@ -1798,16 +1798,16 @@ subtest '->set_password' => sub { > }; > > $schema->storage->txn_begin; >-subtest 'filter_by_dateexpiry' => sub { >+subtest 'filter_by_expiration_date' => sub { > plan tests => 3; >- my $count1 = Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count; >+ my $count1 = Koha::Patrons->filter_by_expiration_date({ days => 28 })->count; > my $patron1 = $builder->build_object({ class => 'Koha::Patrons' }); > $patron1->dateexpiry( dt_from_string->subtract(days => 27) )->store; >- is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1, 'No more expired' ); >+ is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1, 'No more expired' ); > $patron1->dateexpiry( dt_from_string->subtract(days => 28) )->store; >- is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1 + 1, 'One more expired' ); >+ is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1 + 1, 'One more expired' ); > $patron1->dateexpiry( dt_from_string->subtract(days => 29) )->store; >- is( Koha::Patrons->filter_by_dateexpiry({ days => 28 })->count, $count1 + 1, 'Same number again' ); >+ is( Koha::Patrons->filter_by_expiration_date({ days => 28 })->count, $count1 + 1, 'Same number again' ); > }; > > subtest 'search_unsubscribed' => sub { >-- >2.20.1
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 21549
:
108000
|
108001
|
111480
|
111481
|
113914
|
113915
|
118493
|
118494
|
118495
|
118496
|
118517
|
118518
|
118519
|
118520
|
118521
|
119457
|
119458
|
119459
|
119460
|
119461
|
119462
|
119463
|
119464
|
119525
|
119526
|
119527