From 62cc8ea4b1ee5263c73d0d06d81208f054b709cd Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Nov 2016 08:07:02 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 17569: Do not limit by branch if option is not passed Signed-off-by: Josef Moravec --- misc/cronjobs/membership_expiry.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index 3b4b885..260a9f8 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -167,7 +167,13 @@ if( !$expdays ) { my $admin_adress = C4::Context->preference('KohaAdminEmailAddress'); warn 'getting upcoming membership expires' if $verbose; -my $upcoming_mem_expires = Koha::Patrons->search_upcoming_membership_expires({ 'me.branchcode' => $branch, before => $before, after => $after }); +my $upcoming_mem_expires = Koha::Patrons->search_upcoming_membership_expires( + { + ( $branch ? ( 'me.branchcode' => $branch ) : () ), + before => $before, + after => $after, + } +); warn 'found ' . $upcoming_mem_expires->count . ' soon expiring members' if $verbose; -- 2.1.4