From 14422c8ed9df29a6b89e8afe69c4d05056618124 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 15 Dec 2010 20:38:23 +0100 Subject: [PATCH] Bug 5700: MT4004 : additem.pl Some Status were not defaulted to the correct value Status 0 was lost because test was done on value and not on the fact that a value was defined or not. when value is 0 then it was not used as default value for Signed-off-by: Chris Cormack --- cataloguing/additem.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 73176982bd..c6f9daf582 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -602,13 +602,16 @@ foreach my $tag ( keys %{$tagslib}){ next if ($tagslib->{$tag}->{$subtag}->{'tab'} ne "10"); next if any { /^$tag$subtag$/ } @fields; - my $value = ""; - my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); - - push (@loop_data, $subfield_data); - $i++; - } + my @values = (undef); + @values = $itemrecord->field($tag)->subfield($subtag) if ($itemrecord && defined($itemrecord->field($tag)->subfield($subtag))); + for my $value (@values){ + my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); + push (@loop_data, $subfield_data); + $i++; + } } +} + # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. $template->param( title => $record->title() ) if ($record ne "-1"); $template->param( -- 2.39.5