Summary: | Add unit test for BatchCommitItems | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Tools | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Martin Renvoize (ashimema) <martin.renvoize> |
Severity: | major | ||
Priority: | P5 - low | CC: | 1joynelson, arthur.suzuki, david, jonathan.druart, lucas, martin.renvoize, tomascohen, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28152 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
22.11.00, 22.05.01, 21.11.07
|
|
Circulation function: | |||
Bug Depends on: | 28152, 30830 | ||
Bug Blocks: | |||
Attachments: |
Bug 30831: Unit test
Bug 30831: Store error in import_error column Bug 30831: Unit test Bug 30831: Unit test |
Description
Nick Clemens (kidclamp)
2022-05-23 12:23:47 UTC
Created attachment 135260 [details] [review] Bug 30831: Unit test Created attachment 135262 [details] [review] 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_id=2 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 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 :( (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 (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 Created attachment 135280 [details] [review] Bug 30831: Unit test Signed-off-by: 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! Created attachment 135297 [details] [review] Bug 30831: Unit test Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> PQA Pushed to master for 22.11, thanks! Pushed to 22.05.x for 22.05.01 pushed to 21.11.x for 21.11.07, thx! Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. |