From 2345dc7c27381aad51d5c1a7f566a9ce0b728ac5 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Mon, 9 Nov 2009 09:38:25 +0100 Subject: [PATCH] (bug #3778) GetBranchesLoop and searchMyLibraryFirst This fix GetBranchesLoop, if searchmylibraryfirst is disabled, getbranchesloop mustn't select any branch. --- C4/Branch.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index 18177ec651..34f716ab77 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -156,10 +156,11 @@ sub GetBranchesLoop (;$$) { # since this is what most pages want anyway my $onlymine = @_ ? shift : onlymine(); my $branches = GetBranches($onlymine); my @loop; + my $searchMyLibraryFirst = C4::Context->preference("SearchMyLibraryFirst");; foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { push @loop, { value => $_, - selected => ($_ eq $branch) ? 1 : 0, + selected => (($_ eq $branch) && $searchMyLibraryFirst ) ? 1 : 0, branchname => $branches->{$_}->{branchname}, }; } -- 2.11.0