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.
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
Testing this one..
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)
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.