[Bug 30831] New: Incorrect setting of error when importing items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Bug ID: 30831 Summary: Incorrect setting of error when importing items Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org In C4::ImportBatch::BatchCommitItems we attempt to store the error 'duplicate item barcode' in the 'itemnumber' column of import_items This fails To recreate: 1 - Export a record with items from the catalog 2 - Stage the record for import 3 - Import the batch 4 - Silent failure? Batch stuck in 'importing 5 - Bonus points/QA team, otherwise skip: Stage again, go to manage batch, before clicking 'Import this batch' a - Right click and inspect the submit button b - Scroll to <form> element c - Right click and 'Edit as HTML' d - Add '?runinbackground=0' to form action e - Delete the hidden input for 'runinbackground' a few lines down f - Click 'Import' g - Error: [Mon May 23 10:47:43.583448 2022] [cgi:error] [pid 3114] [client 172.18.0.1:60936] AH01215: C4::ImportBatch::BatchCommitItems(): DBI Exception: DBD::mysql::st execute failed: Incorrect integer value: 'duplicate item barcode' for column `koha_kohadev`.`import_items`.`itemnumber` at row 1 at /kohadevbox/koha/C4/ImportBatch.pm line 652: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135260 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135260&action=edit Bug 30831: Unit test -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30830 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30830 [Bug 30830] Add Koha Objects for Koha Import Items -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 135262 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135262&action=edit Bug 30831: Store error in import_error column To test: 1 - Export a record with items from the catalog 2 - Stage the record for import 3 - Import the batch 4 - Silent failure? Batch stuck in 'importing 5 - Bonus points/QA team, otherwise skip: Stage again, go to manage batch, before clicking 'Import this batch' a - Right click and inspect the submit button b - Scroll to <form> element c - Right click and 'Edit as HTML' d - Add '?runinbackground=0' to form action e - Delete the hidden input for 'runinbackground' a few lines down f - Click 'Import' g - Error: [Mon May 23 10:47:43.583448 2022] [cgi:error] [pid 3114] [client 172.18.0.1:60936] AH01215: C4::ImportBatch::BatchCommitItems(): DBI Exception: DBD::mysql::st execute failed: Incorrect integer value: 'duplicate item barcode' for column `koha_kohadev`.`import_items`.`itemnumber` at row 1 at /kohadevbox/koha/C4/ImportBatch.pm line 652: /kohadevbox/koha/tools/manage-marc-import.pl, referer: http://localhost:8081/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_... 6 - Apply patch 7 - Stage and import record again 8 - Import success! 9 - Note results report 'Number of items ignored because of duplicate barcode' equal to number of items on record -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | CC| |jonathan.druart+koha@gmail. | |com, | |joy@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am pretty sure I talked about this issue on a bug with Joubu and that there was a patch, but I can't find it :( -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28152 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #3)
I am pretty sure I talked about this issue on a bug with Joubu and that there was a patch, but I can't find it :(
Bug 28152 - SO, but no unit tests, otherwise essentially the same patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135262|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Incorrect setting of error |Add unit test for |when importing items |BatchCommitItems -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |28152 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28152 [Bug 28152] Hidden error when importing an item with an existing itemnumber -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Nick Clemens from comment #4)
(In reply to Katrin Fischer from comment #3)
I am pretty sure I talked about this issue on a bug with Joubu and that there was a patch, but I can't find it :(
Bug 28152 - SO, but no unit tests, otherwise essentially the same patch
PQA on that one,just a unit test here now -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135260|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 135280 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135280&action=edit Bug 30831: Unit test Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #7 from David Nind <david@davidnind.com> --- Testing notes: - Ran prove t/db_dependent/ImportBatch.t before and after applying the patch: tests passed - After applying the patch (including dependencies) the import now works! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135280|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 135297 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135297&action=edit Bug 30831: Unit test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com Status|Passed QA |Pushed to master --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.01 released in| | --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Pushed to 22.05.x for 22.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Status|Pushed to stable |Pushed to oldstable --- Comment #12 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- pushed to 21.11.x for 21.11.07, thx! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |Needs documenting --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.01 |22.11.00, 22.05.01, released in| |21.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Bug 30831 depends on bug 28152, which changed state. Bug 28152 Summary: Hidden error when importing an item with an existing itemnumber https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28152 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30831 Bug 30831 depends on bug 30830, which changed state. Bug 30830 Summary: Add Koha Objects for Koha Import Items https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30830 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org