@@ -, +, @@
plugin, to not overwrite the previously saved value
---
C4/Items.pm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/C4/Items.pm
+++ a/C4/Items.pm
@@ -3058,15 +3058,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
--