Bug 36958

Summary: Internal server error when importing MARC file with bad encoding into an order
Product: Koha Reporter: Emily Lamancusa (emlam) <emily.lamancusa>
Component: MARC Bibliographic record staging/importAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
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)

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.