From c5aa6762945b2889f328f5e0d4562f6a99fcee70 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 13 Jan 2016 16:13:36 +0000 Subject: [PATCH] Bug 15568: Fix display default circ rules To reproduce: Go on the admin circ rules page (admin/smart-rules.pl), switch the dropdown list from specific to "all libraries". The rules are not displayed anymore. Test plan: Apply this patch and confirm that the rules are now displayed correctly. Make sure the enh introduced by bug 11625 is not broken. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Jesse Weaver --- admin/smart-rules.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index ff8c67abd8..e120bd8c16 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -48,12 +48,14 @@ my ($template, $loggedinuser, $cookie) my $type=$input->param('type'); -my $branch; -if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { - $branch = $input->param('branch') || Koha::Libraries->search->count() == 1 ? undef : C4::Branch::mybranch(); -} -else { - $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' ); +my $branch = $input->param('branch'); +unless ( $branch ) { + if ( C4::Context->preference('DefaultToLoggedInLibraryCircRules') ) { + $branch = Koha::Libraries->search->count() == 1 ? undef : C4::Branch::mybranch(); + } + else { + $branch = C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*'; + } } $branch = '*' if $branch eq 'NO_LIBRARY_SET'; -- 2.39.5