[Koha-patches] [PATCH] Bug 3713 Dont ignore existing value in branch values

Colin Campbell colin.campbell at ptfs-europe.com
Thu Aug 12 11:54:42 CEST 2010


When editing items the user library rather than the existing value
was being selected as the default value in the branch fields
of the item
This keeps the user's current library as the default when adding
a new item
---
 cataloguing/additem.pl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl
index ea4daf9..16f2a03 100755
--- a/cataloguing/additem.pl
+++ b/cataloguing/additem.pl
@@ -430,10 +430,12 @@ foreach my $tag (sort keys %{$tagslib}) {
       # builds list, depending on authorised value...
   
       if ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "branches" ) {
-          foreach my $thisbranch (@$branches) {
+          foreach my $thisbranch (@{$branches}) {
               push @authorised_values, $thisbranch->{value};
               $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
-             # $value = $thisbranch->{value} if $thisbranch->{selected};
+              if (!$value && $thisbranch->{selected}) {
+                  $value = $thisbranch->{value};
+              }
           }
       }
       elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
-- 
1.7.2.1



More information about the Koha-patches mailing list