Currently, if you've turned on z3950NormalizeAuthor and you have MARC21 records, you're going to get errors in the sub MARCfindbreeding in addbiblio.pl. It's because... 1) Koha checks the imported MARC record for a field nominated by biblio.author (which is 100$a in most MARC21 installs). If that nominated tag is found in the imported MARC record, it will try to create a new empty field with the same tag (and no indicators). 2) Then, regardless of the outcome, it will try deleting that old field from the record. 3) Then, for each of the tags in z3950AuthorAuthFields, it will try taking the new $field (without checking to see if it's actually already been created) and filling it with a re-arrangement of subfield values from the old field. 4) Then, after it has tried adding all the subfields, it will try to insert the $field back into the $record (again, without checking to see if there is even a valid $field MARC object in the first place). Steps 3 and 4 cause Koha to get upset. Personally, I don't see the utility of "normalizing" the author, but I'm not familiar with UNIMARC. From a coding point of view, I think this section of code could benefit from some error-checking. From the point of view of a MARC21 user, I'm tempted to just wrap it with a MarcFlavour check, and ignore it since it should never be used by MARC21 users.
Silly me...I should've checked master more thoroughly. There is already a check to make sure that the marcflavour is UNIMARC. However, I think it would still be a good idea to re-visit this bit of code. There are no checks to make sure that $field is initialized as a MARC object before creating it. It seems to be a bizarre bit of code...
Closing this due to age