Bug 27171 - Batch record modification fails to add 942c
Summary: Batch record modification fails to add 942c
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-08 13:11 UTC by Magnus Enger
Modified: 2021-12-13 21:10 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2020-12-08 13:11:51 UTC
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
Comment 1 Magnus Enger 2021-02-05 14:06:54 UTC
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.