diff --git a/C4/Branch.pm b/C4/Branch.pm index 9ec155a273..44da91d493 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -133,9 +133,9 @@ sub GetBranches { return ( \%branches ); } -sub GetBranchesLoop ($;$) { # since this is what most pages want anyway - my $branch = shift or return undef; - my $onlymine = shift || C4::Context->preference("IndependantBranches"); +sub GetBranchesLoop (;$$) { # since this is what most pages want anyway + my $branch = @_ ? shift : ''; # optional first argument is branchcode of "my branch", if preselection is wanted. + my $onlymine = @_ ? shift : C4::Context->preference("IndependantBranches"); my $branches = GetBranches($onlymine); my @loop; foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {