@@ -, +, @@ --- 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(-) --- a/debian/koha-common.cron.daily +++ a/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 --- a/misc/cronjobs/cleanup_database.pl +++ a/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, --- a/misc/cronjobs/crontab.example +++ a/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 --- a/t/db_dependent/Members.t +++ a/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 --