@@ -, +, @@ ideally testing all action types (Delete/Add new/Update existing or add new/Move/Copy/Copy and replace); make sure you input a 0 (integer zero) in the text box for the subfield value(s). from the action description. graphic record using the modification template you just created. Observe that you get an error in the system logs if you click on 'Show MARC' or 'Modify selected records'. the action description and the Batch record modification should work without problems. --- Koha/SimpleMARC.pm | 4 ++-- .../prog/en/modules/tools/marc_modification_templates.tt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) --- a/Koha/SimpleMARC.pm +++ a/Koha/SimpleMARC.pm @@ -164,7 +164,7 @@ sub update_field { if ( ! ( $record && $fieldName ) ) { return; } - if ( not $subfieldName or $subfieldName eq '' ) { + if ( not defined $subfieldName or $subfieldName eq '' ) { # FIXME I'm not sure the actual implementation is correct. die "This action is not implemented yet"; #_update_field({ record => $record, field => $fieldName, values => \@values }); @@ -296,7 +296,7 @@ sub read_field { my $subfieldName = $params->{subfield}; my $field_numbers = $params->{field_numbers} // []; - if ( not $subfieldName or $subfieldName eq '' ) { + if ( not defined $subfieldName or $subfieldName eq '' ) { _read_field({ record => $record, field => $fieldName, field_numbers => $field_numbers }); } else { _read_subfield({ record => $record, field => $fieldName, subfield => $subfieldName, field_numbers => $field_numbers }); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -133,14 +133,14 @@ field - [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield | html %][% END %] + [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield.length ) %]$[% ActionsLoo.from_subfield | html %][% END %] [% IF ( ActionsLoo.field_value ) %] with value [% ActionsLoo.field_value | html %] [% END %] [% IF ( ActionsLoo.to_field ) %] - to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield ) %]$[% ActionsLoo.to_subfield | html %][% END %] + to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield.length ) %]$[% ActionsLoo.to_subfield | html %][% END %] [% IF ( ActionsLoo.to_regex_search ) %] using RegEx s/[% ActionsLoo.to_regex_search | html %]/[% ActionsLoo.to_regex_replace | html %]/[% ActionsLoo.to_regex_modifiers | html %] @@ -151,7 +151,7 @@ [% IF ( ActionsLoo.conditional_if ) %] if [% END %] [% IF ( ActionsLoo.conditional_unless ) %] unless [% END %] - [% ActionsLoo.conditional_field | html %][% IF ( ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield | html %][% END %] + [% ActionsLoo.conditional_field | html %][% IF ( ActionsLoo.conditional_subfield.length ) %]$[% ActionsLoo.conditional_subfield | html %][% END %] [% IF ( ActionsLoo.conditional_comparison_exists ) %] exists [% END %] [% IF ( ActionsLoo.conditional_comparison_not_exists ) %] does not exist [% END %] --