Bug 10906

Summary: Reimported records into Koha are imported only as DEFAULT frameworks, not what they were originally
Product: Koha Reporter: Cecil Hillyard <ceciloh>
Component: MARC Bibliographic record staging/importAssignee: Jacek Ablewicz <abl>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: abl, chris, marjorie.barry-vila, nengard, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11064
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13947
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 10906 - Reimported records into Koha are imported only as DEFAULT frameworks, not what they were originally
Bug 10906 - Reimported records into Koha are imported only as DEFAULT frameworks, not what they were originally
[PASSED QA] Bug 10906 - Reimported records into Koha are imported only as DEFAULT frameworks, not what they were originally

Description Cecil Hillyard 2013-09-17 20:38:02 UTC
Our bibliographic records have differing frameworks for the various formats.  We do NOT use the default framework. We then use MarcEdit to add all those nifty  RDA fields to our  records.

We catalog our records and then export them to MarcEdit.  MarcEdit does its stuff and then we reimport the records back into Koha.  This is where the problem lies.  They get reimported back into Koha with the DEFAULT framework.  

This did NOT happen when we were on 3.8 but it is happening now in 3.10 and it looks like it also happens in 3.12.   They match just fine on the control number but the framework changes.

This adds much time and  steps to our cataloging process.  Is this a bug or an enhancement request?  

I've been informed that this is how it is supposed to work.

Cecil Hillyard
Washoe County Library
Reno, Nevada
Comment 1 Nicole C. Engard 2013-10-16 21:43:24 UTC
I want to add to this that the problem is also a language issue - the text says "Add new bibliographic records into this framework" but the records in question aren't 'new' so that's where part of the confusion occurs
Comment 2 Jacek Ablewicz 2015-03-23 12:52:38 UTC
This is still broken in current master (but only when records are being matched & replaced when importing; for the records imported 'as new', framework choosen by the user seems to be saved and retained properly - ?).

Looks like some changes introduced by commit 82dc7b55a8b5a7642a906dcd8963952b7464adb1 ("Bug 4321: clean C4::Biblio::GetBiblio and uses") got inadvertantly reverted by next commmit (6e71b80ca39e6f1d2c31659a9a656de807ef3f32, "Bug 7475: Teach matching rules to handle authorities").

Another remaining place where GetBiblio() return results are wrongly assigned is serials/subscription-history.pl script.
Comment 3 Jacek Ablewicz 2015-03-23 14:59:11 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2015-04-02 14:53:46 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2015-04-03 13:24:17 UTC
Created attachment 37456 [details] [review]
[PASSED QA] Bug 10906 - Reimported records into Koha are imported only as DEFAULT frameworks, not what they were originally

Existing framework code is currently not retained when local record
gets replaced during batch import, or when the restore/reverse function
is being used.

This patch fixes aforementioned issues by correcting outdated GetBiblio()
calls in C4/ImportBatch.pm

To test:

1/ try to replicate the issue: import some MARC records with
"Tools -> Stage MARC records for import" etc., using test setup,
matching rules and so on such that some existing records will get
replaced with imported ones
2/ observe that records replaced during import now open in the editor
with 'Default' framework, even if they have some other framework
set up previously
3/ apply patch
4/ redo 1/, confirming that this problem is no longer replicable
5/ try use 'restore' function with some freshly imported
records, ensure that original framework code got retained
in the records which had their imports reverted

NOTE: I confirmed this change by
1) git grep "=\s*GetBiblio\s*("
   -- this shows how GetBiblio is called elsewhere.
      It differed! So then...
2) vi C4/Biblio.pm
   /sub GetBiblio
   -- find the right one, notice it only returns a HASH ref,
      not an array.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi (tcohen) 2015-04-12 03:54:05 UTC
Patch pushed to master.

Thanks Jacek!
Comment 7 Chris Cormack 2015-04-20 10:09:01 UTC
Pushed to 3.18.x will be in 3.18.6
Comment 8 Jonathan Druart 2015-06-16 11:36:57 UTC
*** Bug 11064 has been marked as a duplicate of this bug. ***