Bug 36958 - Internal server error when importing MARC file with bad encoding into an order
Summary: Internal server error when importing MARC file with bad encoding into an order
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic record staging/import (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-24 14:15 UTC by Emily Lamancusa (emlam)
Modified: 2024-09-10 09:56 UTC (History)
1 user (show)

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


Attachments
Test record in MARC 8 with an encoding error (uses extended character set for Simplified Chinese characters) (4.79 KB, application/marc)
2024-05-24 14:15 UTC, Emily Lamancusa (emlam)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa (emlam) 2024-05-24 14:15:10 UTC
Created attachment 167168 [details]
Test record in MARC 8 with an encoding error (uses extended character set for Simplified Chinese characters)

To reproduce:
1. Go to Cataloguing > Stage Records for Import
2. Upload the attached example file, which is encoded in MARC 8
3. Select the correct encoding and stage the file for import
4. Find or create an open basket in the Acquisitions module
5. Click Add to basket
6. Select From a staged file
7. Select the file that was just staged
--> Page crashes with Internal Server Error (or a stack trace if you're testing in KTD)

On the other hand, if you return to Cataloguing > Manage Staged Records and import the staged file from there, the import completes and the records are added to the catalog. The badly encoded biblio records can still be viewed (and the biblio detail page displays a warning about the bad encoding).

Not sure if it makes sense to allow addorderiso2709.pl to simply import the bad record anyway like manage-marc-import.pl does, or if that would break something else in the ordering process. At the very least it should display an error message instead of crashing.
Comment 1 Emily Lamancusa (emlam) 2024-05-24 14:21:28 UTC
Even better if it could identify which bibs have errors, and either skip them and import the rest, or at least include some useful information in the error message.