@@ -, +, @@ --- C4/Auth.pm | 8 +------- C4/Branch.pm | 9 +++++---- 2 files changed, 6 insertions(+), 11 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -934,17 +934,11 @@ sub checkauth { my $value = $query->param($name); push @inputs, { name => $name, value => $value }; } - # get the branchloop, which we need for authentication - my $branches = GetBranches(); - my @branch_loop; - for my $branch_hash (sort keys %$branches) { - push @branch_loop, {branchcode => "$branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, }; - } my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl'; my $template = C4::Templates::gettemplate($template_name, $type, $query ); $template->param( - branchloop => \@branch_loop, + branchloop => GetBranchesLoop(), opaccolorstylesheet => C4::Context->preference("opaccolorstylesheet"), opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"), login => 1, --- a/C4/Branch.pm +++ a/C4/Branch.pm @@ -160,11 +160,12 @@ sub GetBranchesLoop { # since this is what most pages want anyway my $onlymine = @_ ? shift : onlymine(); my $branches = GetBranches($onlymine); my @loop; - foreach ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) { + foreach my $branchcode ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) { push @loop, { - value => $_, - selected => ($_ eq $branch) ? 1 : 0, - branchname => $branches->{$_}->{branchname}, + value => $branchcode, + branchcode => $branchcode, + selected => ($branchcode eq $branch) ? 1 : 0, + branchname => $branches->{$branchcode}->{branchname}, }; } return \@loop; --