@@ -, +, @@ and click on the details of a record. not existing number. Instead of an internal server error, you should see a message like "The authority record you requested does not exist". --- authorities/authorities.pl | 3 ++- authorities/detail.pl | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) --- a/authorities/authorities.pl +++ a/authorities/authorities.pl @@ -660,12 +660,13 @@ if ($op eq "duplicate") my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypetext'] } ); +my $type = $authority_types->find($authtypecode); $template->param( authority_types => $authority_types, authtypecode => $authtypecode, authid => $authid, linkid => $linkid, - authtypetext => $authority_types->find($authtypecode)->authtypetext, + authtypetext => $type ? $type->authtypetext : "", hide_marc => C4::Context->preference('hide_marc'), ); output_html_with_http_headers $input, $cookie, $template->output; --- a/authorities/detail.pl +++ a/authorities/detail.pl @@ -178,7 +178,8 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( my $authid = $query->param('authid'); -my $authtypecode = Koha::Authorities->find($authid)->authtypecode; +my $authobj = Koha::Authorities->find($authid); +my $authtypecode = $authobj ? $authobj->authtypecode : q{}; $tagslib = &GetTagsLabels(1,$authtypecode); # Build list of authtypes for showing them @@ -209,15 +210,16 @@ my $biblio_fields; while (my ($tagfield) = $sth->fetchrow) { $biblio_fields.= $tagfield."9,"; } -chop $biblio_fields; +chop $biblio_fields if $biblio_fields; build_tabs ($template, $record, $dbh,"",$query); +my $type = $authority_types->find($authtypecode); $template->param( authid => $authid, count => $count, biblio_fields => $biblio_fields, - authtypetext => $authority_types->find($authtypecode)->authtypetext, + authtypetext => $type ? $type->authtypetext: "", authtypecode => $authtypecode, authority_types => $authority_types, csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }), --