Bugzilla – Attachment 49437 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]
[SIGNED-OFF] Bug 16056: [ALT] Do not crash when searching for an authority if zebra's index is not up-to-date
SIGNED-OFF-Bug-16056-ALT-Do-not-crash-when-searchi.patch (text/plain), 1.81 KB, created by
Owen Leonard
on 2016-03-23 12:53:05 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16056: [ALT] Do not crash when searching for an authority if zebra's index is not up-to-date
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-03-23 12:53:05 UTC
Size:
1.81 KB
patch
obsolete
>From 52ee0b266fadf27e9d563d35bdcd49ec100d4ad3 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] [SIGNED-OFF] Bug 16056: [ALT] Do not crash when searching for > an authority if zebra's index is not up-to-date >Content-Type: text/plain; charset="utf-8" > >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. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >This patch fixes the error, and does so in a way which I think makes >more sense than the other patch. I do no expect to see deleted record in >my search results. >--- > 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.1.4
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