From 333c7a26691524e0cb71a4fc28193eca2377b774 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 14 Jan 2016 17:30:42 +0000 Subject: [PATCH] Bug 15568 (Follow up) Replace call to C4::Branches::GetBranchesCount with Koha::Libraries->search->count --- admin/smart-rules.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index c92473c..9fd4118 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; @@ -50,7 +51,7 @@ my $type=$input->param('type'); my $branch = $input->param('branch'); unless ( $branch ) { if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { - $branch = GetBranchesCount() == 1 ? undef : C4::Branch::mybranch(); + $branch = Koha::Libraries->search->count == 1 ? undef : C4::Branch::mybranch(); } else { $branch = C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*'; -- 2.1.4