Bugzilla – Attachment 42700 Details for
Bug 6810
Send membership expiry reminder notices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6810: [QA Follow-up] Exit cronjob if pref not set
Bug-6810-QA-Follow-up-Exit-cronjob-if-pref-not-set.patch (text/plain), 3.58 KB, created by
Marcel de Rooy
on 2015-09-18 11:32:37 UTC
(
hide
)
Description:
Bug 6810: [QA Follow-up] Exit cronjob if pref not set
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-09-18 11:32:37 UTC
Size:
3.58 KB
patch
obsolete
>From e81f9e13defa903a0b43a140651f17e46492c68f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 18 Sep 2015 13:22:42 +0200 >Subject: [PATCH] Bug 6810: [QA Follow-up] Exit cronjob if pref not set >Content-Type: text/plain; charset=utf-8 > >As per suggestion of Robin on report 14840, it would be better to always >run the cronjob and only do something when the pref is set. >This patch adds a test in the cronjob and clears the former default of 14 >days. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Removed the pref and ran the dbrev again: Fine. >Run the cronjob with -c -v -n: Prints exit warning. >--- > .../bug_6810-add_MembershipExpiryDaysNotice_syspref.sql | 2 +- > installer/data/mysql/sysprefs.sql | 2 +- > misc/cronjobs/membership_expiry.pl | 8 ++++++++ > 3 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_6810-add_MembershipExpiryDaysNotice_syspref.sql b/installer/data/mysql/atomicupdate/bug_6810-add_MembershipExpiryDaysNotice_syspref.sql >index 19bbba9..bafa1b6 100644 >--- a/installer/data/mysql/atomicupdate/bug_6810-add_MembershipExpiryDaysNotice_syspref.sql >+++ b/installer/data/mysql/atomicupdate/bug_6810-add_MembershipExpiryDaysNotice_syspref.sql >@@ -1 +1 @@ >-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MembershipExpiryDaysNotice',14,'Send an account expiration notice that a patron''s card is about to expire after',NULL,'Integer') >\ No newline at end of file >+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MembershipExpiryDaysNotice',NULL,'Send an account expiration notice that a patron''s card is about to expire after',NULL,'Integer') >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 8ab089a..51acfec 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -211,7 +211,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'), > ('maxRecordsForFacets','20',NULL,NULL,'Integer'), > ('maxreserves','50','','Define maximum number of holds a patron can place','Integer'), >-('MembershipExpiryDaysNotice','14','Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'), >+('MembershipExpiryDaysNotice',NULL,'Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'), > ('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'), > ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), > ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'), >diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl >index 4a0f98b..0cf52c8 100755 >--- a/misc/cronjobs/membership_expiry.pl >+++ b/misc/cronjobs/membership_expiry.pl >@@ -132,6 +132,14 @@ pod2usage(1) if $help || !$confirm; > > cronlogaction(); > >+my $expdays = C4::Context->preference('MembershipExpiryDaysNotice'); >+if( !$expdays ) { >+ #If the pref is not set, we will exit >+ warn 'Exiting membership_expiry.pl: MembershipExpiryDaysNotice not set' >+ if $verbose; >+ exit; >+} >+ > my $admin_adress = C4::Context->preference('KohaAdminEmailAddress'); > warn 'getting upcoming membership expires' if $verbose; > my $upcoming_mem_expires = C4::Members::GetUpcomingMembershipExpires(); >-- >1.7.10.4
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 6810
:
5375
|
9751
|
21870
|
21871
|
21872
|
22459
|
32683
|
32684
|
32689
|
32692
|
33954
|
40090
|
40091
|
40100
|
40120
|
40121
|
40122
|
40179
|
40180
|
40641
|
40642
|
40643
|
40644
|
40645
|
40646
|
40649
|
40665
|
40666
|
40667
|
40685
|
40686
|
40687
|
40688
|
40689
|
40690
|
40700
|
40701
|
40766
|
41916
|
42609
|
42610
|
42611
|
42612
|
42613
| 42700