Bug 39425

Summary: MarcFieldsToOrder should not error out on a duplicated field
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: cslone, matt.blenkinsop
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35026    
Bug Blocks:    

Description Nick Clemens (kidclamp) 2025-03-23 16:02:15 UTC
If a field in MarcFieldsToOrder has two values

price: 020$c

When adding a staged file to a basket you get a 500 error and the logs say something like:
==> /var/log/koha/{site}/plack-error.log <==
Invalid number of fields detected on field 020, please check this file at /usr/share/koha/lib/Koha/MarcOrder.pm line 294.

We should find a way to handle this in the code, or at least provide meaningful feedback to the user
Comment 1 Nick Clemens (kidclamp) 2025-04-01 14:41:31 UTC
I believe the intention here is that all orders will be "complete", you can't do anything with two quantities in a single order.


I think if having less of a field, i.e. one sort1 for several orders it may be expected that the value would be reused

If having more of a field we could simply decide, and document, to use the first or the last