Bug 11650

Summary: multiplicated authorities after link_bibs_to_authorities.pl
Product: Koha Reporter: Janusz Kaczmarek <januszop>
Component: MARC Authority data supportAssignee: Janusz Kaczmarek <januszop>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: chris, jcamins, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: proposed patch
Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl
[PASSED QA] Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl

Description Janusz Kaczmarek 2014-01-31 14:27:32 UTC
Under certain circumstances misc/link_bibs_to_authorities.pl creates
multiple authority with identical heading.

Test scenario:
1. Have some (2-3) biblio records with some repeated headings
   Have BiblioAddsAuthorities = allow, AutoCreateAuthorities = generate
   Have no authority records
2. Run misc/link_bibs_to_authorities.pl script
3. You will get multiple authority records -- one for each occurence of a
   heading in biblio record.
Comment 1 Janusz Kaczmarek 2014-01-31 14:34:41 UTC Comment hidden (obsolete)
Comment 2 Janusz Kaczmarek 2014-01-31 14:39:20 UTC
Jared, I am no sure if you will like this patch (it is related to your Bug 7284 solution).  Perhaps you would have a more elegant idea to sort this out...?
Comment 3 Chris Cormack 2014-06-19 09:32:57 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall (khall) 2014-06-20 16:25:44 UTC
Created attachment 29115 [details] [review]
[PASSED QA] Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl

Under certain circumstances misc/link_bibs_to_authorities.pl creates
multiple authority with identical heading.

Test plan:
1. Have some (2-3) biblio records with some repeated headings
   Have BiblioAddsAuthorities = allow, AutoCreateAuthorities = generate
   Have no authority records
2. Run misc/link_bibs_to_authorities.pl script
3. You will get multiple authority records -- one for each occurence of a
   heading in biblio record.

4. Apply the patch.
5. Repeat 1-3 (remember to have "fresh" biblios, without $9, and no
   authorities).
6. The problem should be fixed.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2014-07-07 15:46:24 UTC
Patch pushed to master.

Thanks Janusz!

Note: we need unit tests for this kind of patches. The change looks simple and easy to spot. I pushed it because it was simple, and noticed we don't have the glue to write tests for this in t/db_dependent/Biblio.t (yet :-D)