Bug 28336 - Cannot change matching rules for authorities
Summary: Cannot change matching rules for authorities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-12 17:00 UTC by Nick Clemens
Modified: 2022-06-06 20:25 UTC (History)
3 users (show)

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


Attachments
Bug 28336: Add missing input for item_action (1.83 KB, patch)
2021-05-12 17:02 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 28336: Add missing input for item_action (1.88 KB, patch)
2021-06-03 22:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28336: Add missing input for item_action (1.95 KB, patch)
2021-07-23 14:44 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-05-12 17:00:28 UTC
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
Comment 1 Nick Clemens 2021-05-12 17:02:19 UTC
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!
Comment 2 Katrin Fischer 2021-06-03 22:52:41 UTC
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
Comment 3 Katrin Fischer 2021-06-03 22:53:33 UTC
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>
Comment 4 Katrin Fischer 2021-06-03 22:55:17 UTC
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?
Comment 5 Kyle M Hall 2021-07-23 14:44:58 UTC
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>
Comment 6 Jonathan Druart 2021-07-26 09:23:54 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 7 Kyle M Hall 2021-07-30 14:28:04 UTC
Pushed to 21.05.x for 21.05.03
Comment 8 Fridolin Somers 2021-08-03 02:42:36 UTC
Pushed to 20.11.x for 20.11.09
Comment 9 Victor Grousset/tuxayo 2021-08-16 18:57:27 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.