Bugzilla – Attachment 54641 Details for
Bug 17118
Regression: Bug 15381 triggers error when trying to clear a linked authority
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17118: (follow-up 15381) Fix regression when clearing a linked authority
Bug-17118-follow-up-15381-Fix-regression-when-clea.patch (text/plain), 2.43 KB, created by
Jonathan Druart
on 2016-08-19 15:15:22 UTC
(
hide
)
Description:
Bug 17118: (follow-up 15381) Fix regression when clearing a linked authority
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-08-19 15:15:22 UTC
Size:
2.43 KB
patch
obsolete
>From 01b326b21cc2c873625f06d8981132f623bef04d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 19 Aug 2016 16:09:55 +0100 >Subject: [PATCH] Bug 17118: (follow-up 15381) Fix regression when clearing a > linked authority > >Changes made on bug 15381 assumed that the authid was always set. >But if the user wants to clear the field of the authority, the script is >called with authid=0 (FIXME...) > >To fix this issue, it's better to move the new calls to > Koha::Authorities->find($authid)->authtypecode >and > Koha::Authority::Types->find($authtypecode); >at the correct place > >Test plan: >1. Edit a record which has a field linked to an > authority record (100a for instance). >2. Click the link which triggers the tag editor. > A pop-up window should be displayed. >3. In the pop-up window, click the "Clear field" > button. >=> Without this patch A second pop-up window opens and displays an error: > Can't call method "authtypecode" on an undefined value at /authorities/blinddetail-biblio-search.pl line 61. >=> With this patch applied the field is correctly cleared. >--- > authorities/blinddetail-biblio-search.pl | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > >diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl >index cab9c74..33b7ef0 100755 >--- a/authorities/blinddetail-biblio-search.pl >+++ b/authorities/blinddetail-biblio-search.pl >@@ -58,14 +58,6 @@ my $authid = $query->param('authid'); > my $index = $query->param('index'); > my $tagid = $query->param('tagid'); > my $relationship = $query->param('relationship'); >-my $authtypecode = Koha::Authorities->find($authid)->authtypecode; >-my $tagslib = &GetTagsLabels( 1, $authtypecode ); >- >-my $auth_type = Koha::Authority::Types->find($authtypecode); >-my $record; >-if ($authid) { >- $record = GetAuthority($authid); >-} > > # open template > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >@@ -82,6 +74,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > my @subfield_loop; > my ($indicator1, $indicator2); > if ($authid) { >+ my $authtypecode = Koha::Authorities->find($authid)->authtypecode; >+ my $auth_type = Koha::Authority::Types->find($authtypecode); >+ my $record = GetAuthority($authid); > my @fields = $record->field( $auth_type->auth_tag_to_report ); > my $repet = ($query->param('repet') || 1) - 1; > my $field = $fields[$repet]; >-- >2.8.1
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 17118
:
54641
|
54671
|
54956