[Koha-bugs] [Bug 17510] MARC modification templates ignore subfield $0

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Feb 1 14:25:09 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510

--- Comment #6 from Andreas Roussos <arouss1980 at gmail.com> ---
As Hugo pointed out, this bug has two aspects.

1) Firstly, there's the issue of the subfield not appearing in the MARC
Modification Template (MMT) action description when its value is 0 (even though
it will appear when editing the action). These are the relevant lines of code
from marc_modification_templates.tt:

136 [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield ) %]$[%
ActionsLoo.from_subfield | html %][% END %] 

143 to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield ) %]$[%
ActionsLoo.to_subfield | html %][% END %]

154 [% ActionsLoo.conditional_field | html %][% IF (
ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield | html
%][% END %]

The problem lies with the "[% IF ( ... ) %]" statements: when the
from/to/conditional subfield value is set to 0 the IF clause will evaluate to
false and therefore the value will not be printed.

2) Secondly, we have an error message coming up in the Plack log file ("This
action is not implemented yet"), and this relates to commit c7d862b (from Bug
11319). In that commit, among other things, the update_field() subroutine was
added to SimpleMARC.pm, the most relevant lines of which are:

167 if ( not $subfieldName or $subfieldName eq '' ) {
168     # FIXME I'm not sure the actual implementation is correct.
169     die "This action is not implemented yet";
170     #_update_field({ record => $record, field => $fieldName, values =>
\@values });
171 } else {
172     _update_subfield({ record => $record, field => $fieldName, subfield =>
$subfieldName, values => \@values, field_numbers => $field_numbers });
173 }

The first condition in the 'if' clause above results in the expression
evaluating to true when a subfield value of 0 (integer zero) or '0' (string
zero) is entered -- hence the error message.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list