Bug 38326

Summary: copyno not copied over when set in MarcItemFieldsToOrder system preference
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: AcquisitionsAssignee: Lucas Gass (lukeg) <lucas>
Status: RESOLVED FIXED QA Contact: Matt Blenkinsop <matt.blenkinsop>
Severity: normal    
Priority: P5 - low CC: esther.melander, laura, matt.blenkinsop, mspinney, sam.sowanick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 38326: Don't convert to copynumber
Bug 38326: Don't convert to copynumber
Bug 38326: Don't convert to copynumber
Bug 38326: (QA follow-up) Tidy

Description Lucas Gass (lukeg) 2024-11-01 16:28:34 UTC
To recreate:

1. Set copynumber in MarcItemFieldsToOrder: copyno: 965$z
2. Have a mrc file that includes this marc field 
3. Stage a mrc file for import
4. Notice the copynumber isn't correctly copied over
Comment 1 Lucas Gass (lukeg) 2024-11-01 16:33:04 UTC
Created attachment 173876 [details] [review]
Bug 38326: Don't convert to copynumber

To test:
1. Set copynumber in MarcItemFieldsToOrder: copyno: 965$z
2. Have a mrc file that includes this marc field
3. Stage a mrc file for import
4. Notice the copynumber isn't correctly copied over
5. APPLY PATCH, restart_all
6. Try again, this time it should work.
Comment 2 Biblibre Sandboxes 2024-11-08 16:39:02 UTC
Created attachment 174287 [details] [review]
Bug 38326: Don't convert to copynumber

To test:
1. Set copynumber in MarcItemFieldsToOrder: copyno: 965$z
2. Have a mrc file that includes this marc field
3. Stage a mrc file for import
4. Notice the copynumber isn't correctly copied over
5. APPLY PATCH, restart_all
6. Try again, this time it should work.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Comment 3 Matt Blenkinsop 2024-11-18 11:35:14 UTC
Created attachment 174678 [details] [review]
Bug 38326: Don't convert to copynumber

To test:
1. Set copynumber in MarcItemFieldsToOrder: copyno: 965$z
2. Have a mrc file that includes this marc field
3. Stage a mrc file for import
4. Notice the copynumber isn't correctly copied over
5. APPLY PATCH, restart_all
6. Try again, this time it should work.

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 4 Matt Blenkinsop 2024-11-18 11:35:16 UTC
Created attachment 174679 [details] [review]
Bug 38326: (QA follow-up) Tidy

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 5 Katrin Fischer 2024-11-18 16:31:09 UTC
Are we sure about this fix?

                 # Handle incorrectly named original parameters for MarcItemFieldsToOrder
                 $iteminfos->{location} = delete $iteminfos->{loc} if $iteminfos->{loc};
-                $iteminfos->{copynumber} = delete $iteminfos->{copyno} if $iteminfos->{copyno};

@Nick can you maybe have a look? It just seems like this was intentionally added at some point. Maybe because the configuration should be using copynumber?
Comment 6 Matt Blenkinsop 2024-11-18 16:55:49 UTC
I think I added that line by mistake as the field in the items table is called 'copynumber' but in the template it is called 'copyno' so Lucas is correct to remove that line otherwise it doesn't render the value in the template and it won't then be passed into the ordering process. The logic for handling the ordering takes in the copyno values and then parses them to the correct 'copynumber' field when creating the items and the orderlines
Comment 7 Katrin Fischer 2024-11-18 16:57:36 UTC
I was missing some kind of explanation :) Thanks for that, Matt!
Comment 8 Katrin Fischer 2024-11-19 15:36:49 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 9 Laura O'Neil 2024-11-27 15:17:04 UTC
Is it possible to backport this to 24.05?
Comment 10 Lucas Gass (lukeg) 2024-12-05 22:37:56 UTC
No Koha/MarcOrder.pm in 24.05.x, so no backport.