Bugzilla – Attachment 49395 Details for
Bug 16056
Error when deleting MARC authority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16056: [ALT] Do not crash when searching for an authority if zebra's index is not up-to-date
Bug-16056-ALT-Do-not-crash-when-searching-for-an-a.patch (text/plain), 1.54 KB, created by
Jonathan Druart
on 2016-03-21 15:38:47 UTC
(
hide
)
Description:
Bug 16056: [ALT] Do not crash when searching for an authority if zebra's index is not up-to-date
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-21 15:38:47 UTC
Size:
1.54 KB
patch
obsolete
>From b09c63f7d6b5b8f86fb9f6914d75731b4e368893 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 21 Mar 2016 15:25:41 +0000 >Subject: [PATCH] Bug 16056: [ALT] Do not crash when searching for an authority > if zebra's index is not up-to-date > >This patch fixes a regression introduced by >commit 7e70202d34d75f988fbaea9b911347417c203aac > Bug 15381: Remove GetAuthType and GetAuthTypeCode > >This second version will change the original behavior: If an authority >record is still indexed by zebra but not in the DB, it won't be >displayed. > >Test plan: >Search for authorities >delete one >The results won't contain the record you have deleted. >--- > C4/AuthoritiesMarc.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index a88d4fa..47e83e6 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -302,7 +302,13 @@ sub SearchAuthorities { > } > } > >- my $thisauthtypecode = Koha::Authorities->find($authid)->authtypecode; >+ my $authority = Koha::Authorities->find($authid); >+ unless ( $authority ) { >+ # The authority does not exist in the DB: Zebra's index is outdated >+ $counter++; >+ next; >+ } >+ my $thisauthtypecode = $authority->authtypecode; > my $thisauthtype = Koha::Authority::Types->find($thisauthtypecode); > unless (defined $thisauthtype) { > $thisauthtypecode = $authtypecode; >-- >2.7.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 16056
:
49394
|
49395
|
49437
|
49810