Bug 13762

Summary: biblionumber field and subfield can be called once in authorities merge
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: CatalogingAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: abl, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13760
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11700
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5572
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 13762 - biblionumber field and subfield can be called once in authorities merge

Description Fridolin Somers 2015-02-25 17:23:11 UTC
In AuthoritiesMarc::merge, the call of
  GetMarcFromKohaField( "biblio.biblionumber", '' )
is into several foreach loops.
This call can be extracted to be executed only once.
Also, the biblionumber of each record can be stored in @reccache to avoid finding it twice.
Comment 1 Fridolin Somers 2015-02-25 17:30:31 UTC
Created attachment 36171 [details] [review]
Bug 13762 - biblionumber field and subfield can be called once in authorities merge

In AuthoritiesMarc::merge, the call of
  GetMarcFromKohaField( "biblio.biblionumber", '' )
is into several foreach loops.
This call can be extracted to be executed only once.
Also, the biblionumber of each record can be stored in @reccache to avoid finding it twice.

Test plan :
- Set syspref dontmerge to 'Do'
- Merging 2 authoritites
- Check linked biblio records are impacted
- Change an authority heading
- Check linked biblio records are impacted
Comment 2 Marcel de Rooy 2015-09-03 11:49:54 UTC
Testing this one..
Comment 3 Marcel de Rooy 2015-09-03 11:54:18 UTC
Merged two authority records (A and B; B removed).
Had a biblio with 100 linked to auth A and 700 to auth B.
After merge and reindex still auth B in the biblio record.
(dontmerge=Do)
Comment 4 Fridolin Somers 2016-10-10 14:24:04 UTC
This patch is just code formatting but this code part needs a lot more. And this part is difficult to test.
I close it so it does not impact Bug 11700.