Bugzilla – Attachment 140748 Details for
Bug 26831
Enable librarians to control when unaccepted private list share invites are removed by the cleanup_database.pl cronjob
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26831: Use new PurgeListShareInvitesOlderThan syspref
Bug-26831-Use-new-PurgeListShareInvitesOlderThan-s.patch (text/plain), 4.47 KB, created by
Alex Buckley
on 2022-09-19 00:43:19 UTC
(
hide
)
Description:
Bug 26831: Use new PurgeListShareInvitesOlderThan syspref
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2022-09-19 00:43:19 UTC
Size:
4.47 KB
patch
obsolete
>From 968bfe03418c08bcdf5a03c3591168849be9c2ff Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 13 Sep 2022 12:09:14 +1200 >Subject: [PATCH] Bug 26831: Use new PurgeListShareInvitesOlderThan syspref > >Enable librarians in the staff client to control when unaccepted list >invites will be removed from the database. > >Test plan: >1. Apply patches > >2. Update database >sudo koha-shell <instance> >cd installer/data/mysql >./updatedatabase.pl > >3. Confirm the PurgeListShareInvitesOlderThan syspref = 14 > >4. Run cleanup_database.pl with --list-invites parameter defined: >sudo koha-shell <instance> >cd misc/cronjobs >./cleanup_database.pl --list-invites 10 -v > >5. Confirm the output contains: >"Purging unaccepted list share invites older than 10 days." > >6. Set PurgeListShareInvitesOlderThan syspref = 15 > >7. Run cleanup_database.pl without the --list-invites parameter: >sudo koha-shell <instance> >cd misc/cronjobs >./cleanup_database.pl -v > >8. Confirm the output contains: >"Purging unaccepted list share invites older than 15 days." > >9. Empty PurgeListShareInvitesOlderThan syspref > >10. Run cleanup_database without the --list-invites parameter: >sudo koha-shell <instance. >cd misc/cronjobs >./cleanup_database.pl > >11. Observe you get the following output (along with documentation on all >parameters of the script): >"You did not specify any cleanup work for the script to do." > >12. Run the cleanup_database with no days defined for the --list-invites >parameter: >sudo koha-shell <instance> >cd misc/cronjobs >./cleanup_database.pl --list-invites -v > >13. Confirm the output contains: >"Purging unaccepted list share invites older than 14 days." > >Sponsored-by: Catalyst IT, New Zealand >--- > misc/cronjobs/cleanup_database.pl | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 74505cf067e..4a5467943a2 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -80,8 +80,11 @@ Usage: $0 [-h|--help] [--confirm] [--sessions] [--sessdays DAYS] [-v|--verbose] > Defaults to 180 days if no days specified. > --searchhistory DAYS purge entries from search_history older than DAYS days. > Defaults to 30 days if no days specified >- --list-invites DAYS purge (unaccepted) list share invites older than DAYS >- days. Defaults to 14 days if no days specified. >+ --list-invites DAYS purge (unaccepted) list share invites older than DAYS days. >+ This parameter is prioritised over the >+ PurgeListShareInvitesOlderThan system preference. >+ Defaults to 14 days if neither this parameter or >+ the PurgeListShareInvitesOlderThan system preference are set. > --restrictions DAYS purge patrons restrictions expired since more than DAYS days. > Defaults to 30 days if no days specified. > --all-restrictions purge all expired patrons restrictions. >@@ -197,10 +200,21 @@ $pLogs = DEFAULT_LOGS_PURGEDAYS if defined($pLogs) > $zebraqueue_days = DEFAULT_ZEBRAQ_PURGEDAYS if defined($zebraqueue_days) && $zebraqueue_days == 0; > $mail = DEFAULT_MAIL_PURGEDAYS if defined($mail) && $mail == 0; > $pSearchhistory = DEFAULT_SEARCHHISTORY_PURGEDAYS if defined($pSearchhistory) && $pSearchhistory == 0; >-$pListShareInvites = DEFAULT_SHARE_INVITATION_EXPIRY_DAYS if defined($pListShareInvites) && $pListShareInvites == 0; > $pDebarments = DEFAULT_DEBARMENTS_PURGEDAYS if defined($pDebarments) && $pDebarments == 0; > $pMessages = DEFAULT_MESSAGES_PURGEDAYS if defined($pMessages) && $pMessages == 0; > >+# Choose the number of days at which to purge unaccepted list invites: >+# - list-invites command line parameter is prioritised first >+# - PurgeListShareInvitesOlderThan system preference is prioritised second >+# - Default value of 14 days (when no days are specified in list-invites parameter) is prioritised last >+if ( !defined($pListShareInvites) ) { >+ if ( C4::Context->preference('PurgeListShareInvitesOlderThan') ) { >+ $pListShareInvites = C4::Context->preference('PurgeListShareInvitesOlderThan'); >+ } >+} elsif ( defined($pListShareInvites) && $pListShareInvites == 0 ) { >+ $pListShareInvites = DEFAULT_SHARE_INVITATION_EXPIRY_DAYS; >+} >+ > if ($help) { > usage(0); > } >-- >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 26831
:
112634
|
140747
|
140748
|
140749
|
140750
|
140751
|
140752
|
157684
|
157685
|
157686
|
157711
|
157712
|
157713
|
157714
|
159097
|
159098
|
159099
|
159100
|
159101
|
159102