Bug 9171

Summary: Vendor sent us a file with holdings in 952 which has repeated subfields and no home or holding branch
Product: Koha Reporter: Michael Hafen <michael.hafen>
Component: MARC Bibliographic record staging/importAssignee: Galen Charlton <gmcharlt>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P5 - low    
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:
Attachments: usmarc file to demonstrate the bug
Proposed patch for master

Description Michael Hafen 2012-11-29 18:48:26 UTC
Created attachment 13785 [details]
usmarc file to demonstrate the bug

Staging a file for import where the item information is in the 952 tag, but lacks home/holding branch information and may have repeated subfields, results in items with no branchcode set and near empty items for the repeated subfields

To test:
stage and import the attached usmarc file and note that some items, like in the first record, are missing the homebranch and holdingbranch information, and because of the repeated 'z' subfield another item record is created just for the repeated field.
Apply patch and stage and import the file again to see that these items are imported correctly.

I had to deal with a file from a vendor which had the holdings information in the 952 tag.  This was for new books, so there was obviously no itemnumber.  There was also no home or holding branch set, so the items got a little lost.  To further complicate matter the 'z' subfield was repeated in a couple fields, and MARC::Record seemed to think those repeated subfields should be in a field by themselves.  So I have a patch which adds code to watch for this missing home/holding branch subfields, and catches repeated subfields that end up in seperate fields.
Comment 1 Michael Hafen 2012-11-29 18:49:14 UTC
Created attachment 13786 [details] [review]
Proposed patch for master
Comment 2 Katrin Fischer 2014-11-02 09:50:22 UTC
I think bug 10877 goes in the same direction as this.

*** This bug has been marked as a duplicate of bug 10877 ***