From 2ad7259ceed345abd63b77d3a04b7fe9f40eef5d 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 --- C4/Items.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 0608803..0e53b2d 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3094,15 +3094,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.1.4