Bug 9811: FIX branches loop was not correctly set
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 10 Jan 2014 10:24:48 +0000 (11:24 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 1 Jul 2014 12:57:40 +0000 (09:57 -0300)
The branches loop was not set with the values.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
members/members-home.pl

index 0024272..584c387 100755 (executable)
@@ -55,10 +55,13 @@ if ( C4::Branch::onlymine ) {
     }
 } else {
     foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %{$branches}) {
+        my $selected = 0;
+        $selected = 1 if $branch and $branch eq $_;
         push @branchloop, {
-            value      => $_,
-            selected   => ($branches->{$_}->{branchcode} eq $branch),
+            value => $_,
+            branchcode => $_,
             branchname => $branches->{$_}->{branchname},
+            selected => $selected
         };
     }
 }