MARC modification templates does not allow to mix control field and the subfield of a regular field, we should allow that. But of course not the mix of an entire regular field and the subfield of a regular field.
I think the form checks could look like that : # Check destination is filled if to_field undefined then "The destination should be filled." # Control field does not need a subfield if from_field is < 10 and from_subfield undefined or to_field is < 10 and to_subfield undefined then "If the field is a control field, the subfield should be empty" # Case source field is a control field if from_field is < 10 then if to_field is >= 10 and to_subfield undefined then "If source field is a control field and destination is a regular field, destination subfield must be filled." # Case source field is a regular field if from_field is >= 10 then if to_field is < 10 and from_subfield undefined then "If source field is a regular field and destination is a control field, source subfield must be filled." if to_field is >= 10 and ( from_subfield defined and to_subfield undefined or from_subfield undefined and to_subfield defined ) then "If source and destination fields are regular fields, both subfield values should be filled or empty."