From d7d79b2af9ea5db22d8df4344b5d07f2e2b42e52 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 (cherry picked from commit 1017edad1c27d2624fb8ed6f8fb0018985b33295) Signed-off-by: Katrin Fischer (cherry picked from commit 18ad4150eadff0f229c1cc73950f8e53568ed249) Signed-off-by: Julian Maurice --- C4/Items.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index ba49b3037b..3af4d1ca30 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -3080,15 +3080,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