From 4c00190250b8c290b6a03e4621ee6c282be0be62 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Nov 2016 08:07:02 +0000 Subject: [PATCH] Bug 17569: Do not limit by branch if option is not passed Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- 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 3b4b8858e8..260a9f8b10 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.39.5