From 3f8a9615d29649be669e96a624c1177f7b2c1884 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Jan 2016 10:21:16 +0000 Subject: [PATCH] Bug 15550: Fix authority search and detail at the OPAC The author of Bug 15381 (me!) has mismatch the objects he was manipulating and forgotten to update a template. for the opac-aythorities-home, the variable is named authority_types, not authtypesloop. In opac-authoritiesdetail.pl, the $record is a MARC::Record and there is no authtypecode method. We need to retrieve the authtypecode using the new Koha::Authorities module. Test plan: Search for authorities at the OPAC and click on the detail link to go to the detail page. Without this patch, you will get errors. With this patch, the errors should have gone and everything should work as before bug 15381. --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt | 8 ++++---- opac/opac-authoritiesdetail.pl | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt index 85ecf8d..d3dfcf8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt @@ -35,11 +35,11 @@
  • diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index b867012..f46c511 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/opac/opac-authoritiesdetail.pl @@ -47,6 +47,7 @@ use CGI qw ( -utf8 ); use MARC::Record; use C4::Koha; +use Koha::Authorities; use Koha::Authority::Types; my $query = new CGI; @@ -75,7 +76,8 @@ if ( ! $record ) { exit; } -my $authtypecode = $record->authtypecode; +my $authority = Koha::Authorities->find( $authid ); +my $authtypecode = $authority->authtypecode; if ($display_hierarchy){ $template->{VARS}->{'displayhierarchy'} = $display_hierarchy; -- 2.1.0