Bugzilla – Attachment 128704 Details for
Bug 28962
Unverified self registrations should be removed shortly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28962: Add del-unv-selfreg to crontab
Bug-28962-Add-del-unv-selfreg-to-crontab.patch (text/plain), 4.51 KB, created by
David Nind
on 2021-12-18 22:53:02 UTC
(
hide
)
Description:
Bug 28962: Add del-unv-selfreg to crontab
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-12-18 22:53:02 UTC
Size:
4.51 KB
patch
obsolete
>From f532c8a3cd25246c7581d7cf59229bbc94af90c3 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 7 Sep 2021 14:14:44 +0000 >Subject: [PATCH] Bug 28962: Add del-unv-selfreg to crontab > >We also add a test by inserting a simulated borrower modification >record in the same table which should not be deleted. > >NOTE: This patch fixes the del-unv-selfreg parameter in the >cleanup db script. It did not even do what it promised :) > >Test plan: >Verify if the crontab change is correct. >Run t/db_dependent/Members.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: David Nind <david@davidnind.com> >--- > debian/koha-common.cron.daily | 2 +- > misc/cronjobs/cleanup_database.pl | 2 +- > misc/cronjobs/crontab.example | 2 +- > t/db_dependent/Members.t | 3 +++ > 4 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/debian/koha-common.cron.daily b/debian/koha-common.cron.daily >index baf956fe4c..c24f9c6043 100644 >--- a/debian/koha-common.cron.daily >+++ b/debian/koha-common.cron.daily >@@ -23,7 +23,7 @@ koha-foreach --chdir --enabled --email /usr/share/koha/bin/cronjobs/advance_noti > koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/serialsUpdate.pl -c > koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/membership_expiry.pl -c > koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/holds/cancel_expired_holds.pl >/dev/null 2>&1 >-koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --confirm --sessions --zebraqueue 10 --list-invites --temp-uploads >+koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/cleanup_database.pl --confirm --sessions --zebraqueue 10 --list-invites --temp-uploads --del-unv-selfreg 14 > koha-foreach --chdir --enabled --noemail /usr/share/koha/bin/cronjobs/cleanup_database.pl --confirm --mail > koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/holds/auto_unsuspend_holds.pl > /dev/null 2>&1 > koha-foreach --chdir --enabled /usr/share/koha/bin/cronjobs/merge_authorities.pl -b >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 7d22d5d5d1..56b7a7d7c4 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -170,7 +170,7 @@ GetOptions( > 'restrictions:i' => \$pDebarments, > 'all-restrictions' => \$allDebarments, > 'del-exp-selfreg' => \$pExpSelfReg, >- 'del-unv-selfreg' => \$pUnvSelfReg, >+ 'del-unv-selfreg:i' => \$pUnvSelfReg, > 'unique-holidays:i' => \$special_holidays_days, > 'temp-uploads' => \$temp_uploads, > 'temp-uploads-days:i' => \$temp_uploads_days, >diff --git a/misc/cronjobs/crontab.example b/misc/cronjobs/crontab.example >index 9d16403993..9bcb01700a 100644 >--- a/misc/cronjobs/crontab.example >+++ b/misc/cronjobs/crontab.example >@@ -84,7 +84,7 @@ KOHA_CRON_PATH = /usr/share/koha/bin/cronjobs > */10 * * * * __KOHA_USER__ $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null > > # clean up databases nightly. Be sure not to run this with --sessions during a time when the system is in use! >-16 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/cleanup_database.pl --confirm --sessions --zebraqueue 10 --list-invites --temp-uploads >+16 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/cleanup_database.pl --confirm --sessions --zebraqueue 10 --list-invites --temp-uploads --del-unv-selfreg 14 > > # delete old purchase suggestions weekly. Replace XX with a number to define the age of suggestions to delete. > @weekly __KOHA_USER__ $KOHA_CRON_PATH/purge_suggestions.pl --confirm --days XX > /dev/null 2>&1 >diff --git a/t/db_dependent/Members.t b/t/db_dependent/Members.t >index b2c39378a0..4854491198 100755 >--- a/t/db_dependent/Members.t >+++ b/t/db_dependent/Members.t >@@ -411,6 +411,9 @@ subtest 'purgeSelfRegistration' => sub { > foreach(1..3) { > $dbh->do("INSERT INTO borrower_modifications (timestamp, borrowernumber, verification_token, changed_fields) VALUES ('2014-01-01 01:02:03',0,?,'firstname,surname')", undef, (scalar localtime)."_$_"); > } >+ # Add a record with a borrowernumber which should not be deleted by DeleteUnverifiedOpacRegistrations >+ # NOTE: We are using the borrowernumber from the last test outside this subtest >+ $dbh->do( "INSERT INTO borrower_modifications (timestamp, borrowernumber, verification_token, changed_fields) VALUES ('2014-01-01 01:02:03', ?, '', 'firstname,surname' )", undef, $borrowernumber ); > is( C4::Members::DeleteUnverifiedOpacRegistrations($d), 3, 'Test for DeleteUnverifiedOpacRegistrations' ); > > #purge members in temporary category >-- >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 28962
:
124617
|
128704
|
129377