Bugzilla – Attachment 99501 Details for
Bug 24114
Remove warn statements from Koha::Patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24114: (QA follow-up) Fix counts for lock, anonymize and delete
Bug-24114-QA-follow-up-Fix-counts-for-lock-anonymi.patch (text/plain), 2.02 KB, created by
Martin Renvoize (ashimema)
on 2020-02-24 12:22:15 UTC
(
hide
)
Description:
Bug 24114: (QA follow-up) Fix counts for lock, anonymize and delete
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-24 12:22:15 UTC
Size:
2.02 KB
patch
obsolete
>From d86a9ca2bd3fecc7c247614e1944398579019086 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 29 Nov 2019 09:45:48 +0000 >Subject: [PATCH] Bug 24114: (QA follow-up) Fix counts for lock, anonymize and > delete > >Since these operations impact on the resultset, the counts should be >saved before. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > misc/cronjobs/cleanup_database.pl | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 7ca7b33177..a1a9cae442 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -332,22 +332,25 @@ if($allDebarments) { > > # Handle unsubscribe requests from GDPR consent form, depends on UnsubscribeReflectionDelay preference > my $unsubscribed_patrons = Koha::Patrons->search_unsubscribed; >+$count = $unsubscribed_patrons->count; > $unsubscribed_patrons->lock( { expire => 1, remove => 1 } ); >-say sprintf "Locked %d patrons", $unsubscribed_patrons->count if $verbose; >+say sprintf "Locked %d patrons", $count if $verbose; > > # Anonymize patron data, depending on PatronAnonymizeDelay > my $anonymize_candidates = Koha::Patrons->search_anonymize_candidates( { locked => 1 } ); >+$count = $anonymize_candidates->count; > $anonymize_candidates->anonymize; >-say sprintf "Anonymized %s patrons", $anonymize_candidates->count if $verbose; >+say sprintf "Anonymized %s patrons", $count if $verbose; > > # Remove patron data, depending on PatronRemovalDelay (will raise an exception if problem encountered > my $anonymized_patrons = Koha::Patrons->search_anonymized; >+$count = $anonymized_patrons->count; > $anonymized_patrons->delete( { move => 1 } ); > if ($@) { > warn $@; > } > elsif ($verbose) { >- say sprintf "Deleted %d patrons", $anonymized_patrons->count; >+ say sprintf "Deleted %d patrons", $count; > } > > if( $pExpSelfReg ) { >-- >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 24114
:
95814
|
95874
|
95875
|
95876
|
99446
|
99447
|
99448
|
99449
|
99450
|
99499
|
99500
| 99501