From 1017edad1c27d2624fb8ed6f8fb0018985b33295 Mon Sep 17 00:00:00 2001 From: Blou Date: Wed, 21 Oct 2015 14:35:18 -0400 Subject: [PATCH] Bug 15030 - Fixes the serials fields associated with a plugin, to not overwrite the previously saved value This fixes the remaining fields from serials-edit.pl that were seeing their previously entered values be oblitarated with each new edit. The fields associated to a plugin (dateaccessioned and barcode) were always displaying with each new edit, losing the previous effort. Signed-off-by: Nick Clemens Signed-off-by: Josef Moravec Signed-off-by: Kyle M Hall --- C4/Items.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index fdcd5f9349..2188ca492b 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3053,15 +3053,18 @@ sub PrepareItemrecordDisplay { }); my $pars = { dbh => $dbh, record => undef, tagslib =>$tagslib, id => $subfield_data{id}, tabloop => undef }; $plugin->build( $pars ); + if ( $itemrecord and my $field = $itemrecord->field($tag) ) { + $defaultvalue = $field->subfield($subfield); + } if( !$plugin->errstr ) { #TODO Move html to template; see report 12176/13397 my $tab= $plugin->noclick? '-1': ''; my $class= $plugin->noclick? ' disabled': ''; my $title= $plugin->noclick? 'No popup': 'Tag editor'; - $subfield_data{marc_value} = qq[...\n].$plugin->javascript; + $subfield_data{marc_value} = qq[...\n].$plugin->javascript; } else { warn $plugin->errstr; - $subfield_data{marc_value} = qq(); # supply default input form + $subfield_data{marc_value} = qq(); # supply default input form } } elsif ( $tag eq '' ) { # it's an hidden field -- 2.39.5