Bugzilla – Attachment 84341 Details for
Bug 21450
link_bibs_to_authorities.pl is caching searches without the auth type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21450: Cache authorities search using term and auth_type
Bug-21450-Cache-authorities-search-using-term-and-.patch (text/plain), 2.76 KB, created by
Nick Clemens (kidclamp)
on 2019-01-24 00:41:00 UTC
(
hide
)
Description:
Bug 21450: Cache authorities search using term and auth_type
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-01-24 00:41:00 UTC
Size:
2.76 KB
patch
obsolete
>From f8ab6e688a55f4ea6889db72d42d886fccce9cdc Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 28 Sep 2018 14:58:20 +0000 >Subject: [PATCH] Bug 21450: Cache authorities search using term and auth_type > >This is a simple fix to prevent incorrect caching of results when using >link_bibs_to_authorities > >To test: >1 - Find or create a record with the same term in a subject and genre >heading >2 - Find or create authority records for the term as a subject and genre >type >3 - Run link bibs to authorities >4 - Verify both tags in the record are linked to the subject heading >5 - Aply patch >6 - Unlink the record and re-run the script (or just re-run) >7 - Each tag should be linked to correct authority >--- > C4/Linker/Default.pm | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > >diff --git a/C4/Linker/Default.pm b/C4/Linker/Default.pm >index b39557cbb7..1fa395c19a 100644 >--- a/C4/Linker/Default.pm >+++ b/C4/Linker/Default.pm >@@ -30,12 +30,13 @@ sub get_link { > my $heading = shift; > my $behavior = shift || 'default'; > my $search_form = $heading->search_form(); >+ my $auth_type = $heading->auth_type(); > my $authid; > my $fuzzy = 0; > >- if ( $self->{'cache'}->{$search_form}->{'cached'} ) { >- $authid = $self->{'cache'}->{$search_form}->{'authid'}; >- $fuzzy = $self->{'cache'}->{$search_form}->{'fuzzy'}; >+ if ( $self->{'cache'}->{$search_form.$auth_type}->{'cached'} ) { >+ $authid = $self->{'cache'}->{$search_form.$auth_type}->{'authid'}; >+ $fuzzy = $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'}; > } > else { > >@@ -72,9 +73,9 @@ sub get_link { > } > } > >- $self->{'cache'}->{$search_form}->{'cached'} = 1; >- $self->{'cache'}->{$search_form}->{'authid'} = $authid; >- $self->{'cache'}->{$search_form}->{'fuzzy'} = $fuzzy; >+ $self->{'cache'}->{$search_form.$auth_type}->{'cached'} = 1; >+ $self->{'cache'}->{$search_form.$auth_type}->{'authid'} = $authid; >+ $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'} = $fuzzy; > } > return $self->SUPER::_handle_auth_limit($authid), $fuzzy; > } >@@ -84,11 +85,12 @@ sub update_cache { > my $heading = shift; > my $authid = shift; > my $search_form = $heading->search_form(); >+ my $auth_type = $heading->auth_type(); > my $fuzzy = 0; > >- $self->{'cache'}->{$search_form}->{'cached'} = 1; >- $self->{'cache'}->{$search_form}->{'authid'} = $authid; >- $self->{'cache'}->{$search_form}->{'fuzzy'} = $fuzzy; >+ $self->{'cache'}->{$search_form.$auth_type}->{'cached'} = 1; >+ $self->{'cache'}->{$search_form.$auth_type}->{'authid'} = $authid; >+ $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'} = $fuzzy; > } > > sub flip_heading { >-- >2.11.0
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 21450
:
79600
|
84340
|
84341
|
89732
|
90076
|
90077
|
90078
|
90088
|
90089
|
90090