Bugzilla – Attachment 46255 Details for
Bug 15467
AuthoritiesMarc.t is failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15467: If authtypecode is not defined, do not explode
Bug-15467-If-authtypecode-is-not-defined-do-not-ex.patch (text/plain), 2.12 KB, created by
Frédéric Demians
on 2016-01-05 14:12:27 UTC
(
hide
)
Description:
Bug 15467: If authtypecode is not defined, do not explode
Filename:
MIME Type:
Creator:
Frédéric Demians
Created:
2016-01-05 14:12:27 UTC
Size:
2.12 KB
patch
obsolete
>From 30adc19756d35a966e7f5c565ceab4f7ddeb30e1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 5 Jan 2016 10:23:16 +0000 >Subject: [PATCH] Bug 15467: If authtypecode is not defined, do not explode >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The test t/db_dependent/AuthoritiesMarc.t fails because one test expect >the BuildSummary subroutine to not crash if the authtypecode passed in >parameter does not exist in the DB. > >Test plan: >prove t/db_dependent/AuthoritiesMarc.t >should return green. > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> > Test fails before patch, and doesn't anymore after. >--- > C4/AuthoritiesMarc.pm | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > >diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm >index 43c5faf..866350e 100644 >--- a/C4/AuthoritiesMarc.pm >+++ b/C4/AuthoritiesMarc.pm >@@ -855,15 +855,17 @@ sub BuildSummary { > # handle $authtypecode is NULL or eq "" > if ($authtypecode) { > my $authref = Koha::Authority::Types->find($authtypecode); >- $summary{authtypecode} = $authref->authtypecode; >- $summary{type} = $authref->authtypetext; >- $summary_template = $authref->summary; >- # for MARC21, the authority type summary displays a label meant for >- # display >- if (C4::Context->preference('marcflavour') ne 'UNIMARC') { >- $summary{label} = $authref->summary; >- } else { >- $summary{summary} = $authref->summary; >+ if ( $authref ) { >+ $summary{authtypecode} = $authref->authtypecode; >+ $summary{type} = $authref->authtypetext; >+ $summary_template = $authref->summary; >+ # for MARC21, the authority type summary displays a label meant for >+ # display >+ if (C4::Context->preference('marcflavour') ne 'UNIMARC') { >+ $summary{label} = $authref->summary; >+ } else { >+ $summary{summary} = $authref->summary; >+ } > } > } > my $marc21subfields = 'abcdfghjklmnopqrstuvxyz68'; >-- >2.6.2
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 15467
:
46247
|
46255
|
46348