Bug 20023: Password recovery using email should be case insensitive
[koha.git] / opac / opac-authoritiesdetail.pl
index f46c511..0f389a0 100755 (executable)
@@ -36,8 +36,7 @@ parameters tables.
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 
 use C4::AuthoritiesMarc;
 use C4::Auth;
@@ -77,14 +76,14 @@ if ( ! $record ) {
 }
 
 my $authority = Koha::Authorities->find( $authid );
-my $authtypecode = $authority->authtypecode;
+my $authtypecode = $authority ? $authority->authtypecode : q{};
 
 if ($display_hierarchy){
     $template->{VARS}->{'displayhierarchy'} = $display_hierarchy;
     $template->{VARS}->{'loophierarchies'} = GenerateHierarchy($authid);
 }
 
-my $count = CountUsage($authid);
+my $count = $authority ? $authority->get_usage_count : 0;
 
 my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
 $template->param(