Bug 6104: Modify item looses branch
authorPaul Poulain <paul.poulain@biblibre.com>
Thu, 7 Apr 2011 09:42:59 +0000 (11:42 +0200)
committerChris Nighswonger <chris.nighswonger@gmail.com>
Sat, 16 Apr 2011 19:19:02 +0000 (15:19 -0400)
If the $value is provided by the item, use it, don't use the librarian branch !

Signed-off-by: Sophie Meynieux <sophie.meynieux@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
(cherry picked from commit b0374db5ffe1ef15a331eea3fd24b50fe8396b3b)

Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
cataloguing/additem.pl

index b2b1192..e2dfc02 100755 (executable)
@@ -150,7 +150,7 @@ sub generate_subfield_form {
                 foreach my $thisbranch (@$branches) {
                     push @authorised_values, $thisbranch->{value};
                     $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
-                    $value = $thisbranch->{value} if $thisbranch->{selected};
+                    $value = $thisbranch->{value} if $thisbranch->{selected} && !$value;
                 }
             }
             elsif ( $subfieldlib->{authorised_value} eq "itemtypes" ) {