Bugzilla – Attachment 29115 Details for
Bug 11650
multiplicated authorities after link_bibs_to_authorities.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl
PASSED-QA-Bug-11650-multiplicated-authorities-afte.patch (text/plain), 3.89 KB, created by
Kyle M Hall (khall)
on 2014-06-20 16:25:44 UTC
(
hide
)
Description:
[PASSED QA] Bug 11650: multiplicated authorities after link_bibs_to_authorities.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-20 16:25:44 UTC
Size:
3.89 KB
patch
obsolete
>From 228fc46c53660c0bfa26481aee6caa64c6b25b4a Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Fri, 31 Jan 2014 15:09:07 +0100 >Subject: [PATCH] [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> >--- > C4/Biblio.pm | 1 + > C4/Linker.pm | 3 +++ > C4/Linker/Default.pm | 12 ++++++++++++ > C4/Linker/FirstMatch.pm | 7 +++++++ > C4/Linker/LastMatch.pm | 7 +++++++ > 5 files changed, 30 insertions(+), 0 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 0ee661b..b0c7ad7 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -634,6 +634,7 @@ sub LinkBibHeadingsToAuthorities { > $heading->auth_type() ); > $field->add_subfields( '9', $authid ); > $num_headings_changed++; >+ $linker->update_cache($heading, $authid); > $results{'added'}->{ $heading->display_form() }++; > } > } >diff --git a/C4/Linker.pm b/C4/Linker.pm >index a3c04f7..2708859 100644 >--- a/C4/Linker.pm >+++ b/C4/Linker.pm >@@ -35,6 +35,9 @@ the match is "fuzzy" (the semantics of "fuzzy" are up to the individual plugin). > In order to handle authority limits, get_link should always end with: > return $self->SUPER::_handle_auth_limit($authid), $fuzzy; > >+B<update_cache ($heading, $authid)> - updates internal linker cache for >+$heading with $authid of a new created authotiry record >+ > B<flip_heading ($field)> - return a MARC::Field object with the heading flipped > to the preferred form. > >diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm >index 445b408..2610085 100644 >--- a/C4/Linker/Default.pm >+++ b/C4/Linker/Default.pm >@@ -79,6 +79,18 @@ sub get_link { > return $self->SUPER::_handle_auth_limit($authid), $fuzzy; > } > >+sub update_cache { >+ my $self = shift; >+ my $heading = shift; >+ my $authid = shift; >+ my $search_form = $heading->search_form(); >+ my $fuzzy = 0; >+ >+ $self->{'cache'}->{$search_form}->{'cached'} = 1; >+ $self->{'cache'}->{$search_form}->{'authid'} = $authid; >+ $self->{'cache'}->{$search_form}->{'fuzzy'} = $fuzzy; >+} >+ > sub flip_heading { > my $self = shift; > my $heading = shift; >diff --git a/C4/Linker/FirstMatch.pm b/C4/Linker/FirstMatch.pm >index ed03d73..ff05070 100644 >--- a/C4/Linker/FirstMatch.pm >+++ b/C4/Linker/FirstMatch.pm >@@ -41,6 +41,13 @@ sub get_link { > return $self->{'default_linker'}->get_link( $heading, 'first' ); > } > >+sub update_cache { >+ my $self = shift; >+ my $heading = shift; >+ my $authid = shift; >+ $self->{'default_linker'}->update_cache( $heading, $authid ); >+} >+ > sub flip_heading { > my $self = shift; > my $heading = shift; >diff --git a/C4/Linker/LastMatch.pm b/C4/Linker/LastMatch.pm >index 9357e95..480bb31 100644 >--- a/C4/Linker/LastMatch.pm >+++ b/C4/Linker/LastMatch.pm >@@ -41,6 +41,13 @@ sub get_link { > return $self->{'default_linker'}->get_link( $heading, 'last' ); > } > >+sub update_cache { >+ my $self = shift; >+ my $heading = shift; >+ my $authid = shift; >+ $self->{'default_linker'}->update_cache( $heading, $authid ); >+} >+ > sub flip_heading { > my $self = shift; > my $heading = shift; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11650
:
24947
|
28982
| 29115