I have created a MARC Modification Template that reads like this: Add new field 942$c with value X if 952$c matches Y. I use the "Batch record modification" tool to run it on a record that should satisfy the criteria, but nothing happens. Same lack of result for "Update existing or add new". This is from the Apache Intranet error log: [Tue Dec 08 13:46:02.752873 2020] [cgi:error] [pid 16705] [client 89.162.88.217:51708] AH01215: [Tue Dec 8 13:46:02 2020] batch_record_modification.pl: Filehandle STDOUT reopened as $fh only for input at /usr/share/perl5/DateTime/TimeZone/Local/Unix.pm line 146.: /usr/share/koha/intranet/cgi-bin/tools/batch_record_modification.pl, referer: https://example.com/cgi-bin/koha/tools/batch_record_modification.pl [Tue Dec 08 13:46:02.753181 2020] [cgi:error] [pid 16705] [client 89.162.88.217:51708] AH01215: [Tue Dec 8 13:46:02 2020] batch_record_modification.pl: Filehandle STDOUT reopened as $fh only for input at /usr/share/perl5/DateTime/TimeZone/Local/Unix.pm line 146.: /usr/share/koha/intranet/cgi-bin/tools/batch_record_modification.pl, referer: https://example.com/cgi-bin/koha/tools/batch_record_modification.pl [Tue Dec 08 13:46:02.767562 2020] [cgi:error] [pid 16705] [client 89.162.88.217:51708] AH01215: [Tue Dec 8 13:46:02 2020] batch_record_modification.pl: Filehandle STDOUT reopened as $fh only for input at /usr/share/koha/lib/Koha/Logger.pm line 154.: /usr/share/koha/intranet/cgi-bin/tools/batch_record_modification.pl, referer: https://example.com/cgi-bin/koha/tools/batch_record_modification.pl [Tue Dec 08 13:46:02.768318 2020] [cgi:error] [pid 16705] [client 89.162.88.217:51708] AH01215: [Tue Dec 8 13:46:02 2020] batch_record_modification.pl: Filehandle STDOUT reopened as $fh only for input at /usr/share/perl5/Log/Log4perl/Config/BaseConfigurator.pm line 51.: /usr/share/koha/intranet/cgi-bin/tools/batch_record_modification.pl, referer: https://example.com/cgi-bin/koha/tools/batch_record_modification.pl [Tue Dec 08 13:46:02.824885 2020] [cgi:error] [pid 16705] [client 89.162.88.217:51708] AH01215: [Tue Dec 8 13:46:02 2020] batch_record_modification.pl: binmode() on closed filehandle STDOUT at /usr/share/koha/lib/C4/Templates.pm line 121.: /usr/share/koha/intranet/cgi-bin/tools/batch_record_modification.pl, referer: https://example.com/cgi-bin/koha/tools/batch_record_modification.pl
The problem here is that 952 (item data) is not part of the record when the MARC Modification Template is processed, so it is not possible to match on that data. Not sure if that should be considered a bug or not, but it was certainly surprising both to me and the customer I was trying to help.