From a4c3455b8c2ba236b1da493adf5edaf214abdc7f 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. Signed-off-by: Hector Castro Works as described. Pull down for choosing the auth_type displayed again Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- .../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 85ecf8d7fd..d3dfcf8a0f 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 b86701290e..f46c5111f4 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.39.5