From c0e773c6e63b9b585764e9477532408c2939ede6 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Tue, 5 Oct 2010 07:48:25 -0400 Subject: [PATCH] Bug 2664: Add item should preselect logged in branch An earlier fix to stop branch values being overwritten in edit items was causing the branch value to be unset when adding items Signed-off-by: Nicole Engard Signed-off-by: Galen Charlton --- cataloguing/additem.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index ea4daf93e1..e6f19d2e70 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -433,7 +433,10 @@ foreach my $tag (sort keys %{$tagslib}) { foreach my $thisbranch (@$branches) { push @authorised_values, $thisbranch->{value}; $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname}; - # $value = $thisbranch->{value} if $thisbranch->{selected}; + # in edit item this is set to the data value otherwise use default + if ($op ne 'edititem' && $thisbranch->{selected} ) { + $value = $thisbranch->{value}; + } } } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { -- 2.39.5