From b43b9bbfb9f452a62f17f0d1a27cb51702e416cf Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 15 Jan 2016 09:35:26 +0000 Subject: [PATCH] Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount Fix conflict with bug 11625 Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- admin/smart-rules.pl | 3 ++- tools/overduerules.pl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 9c903da8a1..ff8c67abd8 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -30,6 +30,7 @@ use Koha::DateUtils; use Koha::Database; use Koha::IssuingRule; use Koha::IssuingRules; +use Koha::Libraries; my $input = CGI->new; my $dbh = C4::Context->dbh; @@ -49,7 +50,7 @@ my $type=$input->param('type'); my $branch; if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { - $branch = $input->param('branch') || GetBranchesCount() == 1 ? undef : C4::Branch::mybranch(); + $branch = $input->param('branch') || Koha::Libraries->search->count() == 1 ? undef : C4::Branch::mybranch(); } else { $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' ); diff --git a/tools/overduerules.pl b/tools/overduerules.pl index 5657b19523..369ac9c452 100755 --- a/tools/overduerules.pl +++ b/tools/overduerules.pl @@ -28,6 +28,7 @@ use C4::Branch; use C4::Letters; use C4::Members; use C4::Overdues; +use Koha::Libraries; our $input = new CGI; my $dbh = C4::Context->dbh; @@ -76,7 +77,7 @@ my $branch = $input->param('branch'); $branch = defined $branch ? $branch : C4::Context->preference('DefaultToLoggedInLibraryOverdueTriggers') ? C4::Branch::mybranch() - : GetBranchesCount() == 1 ? undef + : Koha::Libraries->search->count() == 1 ? undef : undef; $branch ||= q{}; $branch = q{} if $branch eq 'NO_LIBRARY_SET'; -- 2.39.5