To recreate: 1 - Stage a marc file of authorities 2 - Manage the staged file 3 - Attempt to change the matching rule 4 - 500 Error, in intranet-error.log: [Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1
Created attachment 120893 [details] [review] Bug 28336: Add missing input for item_action To test: 1 - Stage a marc file of authorities 2 - Manage the staged file 3 - Attempt to change the matching rule 4 - 500 Error, in intranet-error.log: [Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1 5 - Apply patch 6 - Reload page and change matching rule 7 - Success!
I could not replicate the database error, but I can confirm that this warn is fixed by the patch and the behaviour is improved: [Thu Jun 03 22:49:45.840349 2021] [cgi:error] [pid 12799] [client 10.0.2.2:55280] AH01215: Use of uninitialized value $item_action in string ne at /home/vagrant/kohaclone/tools/manage-marc-import.pl line 159.: /home/vagrant/kohaclone/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl
Created attachment 121613 [details] [review] Bug 28336: Add missing input for item_action To test: 1 - Stage a marc file of authorities 2 - Manage the staged file 3 - Attempt to change the matching rule 4 - 500 Error, in intranet-error.log: [Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1 5 - Apply patch 6 - Reload page and change matching rule 7 - Success! Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
I imagine a different fix could be on pl side - we could set the variable when handling an authority import. Not sure if this would be more practical?
Created attachment 123134 [details] [review] Bug 28336: Add missing input for item_action To test: 1 - Stage a marc file of authorities 2 - Manage the staged file 3 - Attempt to change the matching rule 4 - 500 Error, in intranet-error.log: [Wed May 12 16:53:03.046652 2021] [cgi:error] [pid 52072] [client 172.19.0.1:50580] AH01215: C4::ImportBatch::SetImportBatchItemAction(): DBI Exception: DBD::mysql::st execute failed: Column 'item_action' cannot be null [for Statement "UPDATE import_batches SET item_action = ? WHERE import_batch_id = ?" with ParamValues: 0=undef, 1="1"] at /kohadevbox/koha/tools/manage-marc-import.pl line 160: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=1 5 - Apply patch 6 - Reload page and change matching rule 7 - Success! Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.03
Pushed to 20.11.x for 20.11.09
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.