summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d6c092)
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as described.
$heading->auth_type() );
$field->add_subfields( '9', $authid );
$num_headings_changed++;
$heading->auth_type() );
$field->add_subfields( '9', $authid );
$num_headings_changed++;
+ $linker->update_cache($heading, $authid);
$results{'added'}->{ $heading->display_form() }++;
}
}
$results{'added'}->{ $heading->display_form() }++;
}
}
In order to handle authority limits, get_link should always end with:
return $self->SUPER::_handle_auth_limit($authid), $fuzzy;
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.
B<flip_heading ($field)> - return a MARC::Field object with the heading flipped
to the preferred form.
return $self->SUPER::_handle_auth_limit($authid), $fuzzy;
}
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;
sub flip_heading {
my $self = shift;
my $heading = shift;
return $self->{'default_linker'}->get_link( $heading, 'first' );
}
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;
sub flip_heading {
my $self = shift;
my $heading = shift;
return $self->{'default_linker'}->get_link( $heading, 'last' );
}
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;
sub flip_heading {
my $self = shift;
my $heading = shift;