X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-authoritiesdetail.pl;h=8d5367ffb358f242bc7096bdd96a163262ce8b9b;hb=84825be42adf4a50b77360cf016cd5bfee15c072;hp=278db999c7e1a9542aa353858db8b129f8aabd4e;hpb=b2b16fb8cf4bf89862eba6fc14d507dc79de4db7;p=koha_fer diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl index 278db999c7..8d5367ffb3 100755 --- a/opac/opac-authoritiesdetail.pl +++ b/opac/opac-authoritiesdetail.pl @@ -67,9 +67,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); my $authid = $query->param('authid'); +my $record = GetAuthority( $authid ); +if ( ! $record ) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early + exit; +} + my $authtypecode = &GetAuthTypeCode( $authid ); -my $record; if ($display_hierarchy){ my $trees=BuildUnimarcHierarchies($authid); my @trees = split /;/,$trees ; @@ -83,7 +88,6 @@ if ($display_hierarchy){ foreach my $element (@tree){ my $cell; my $elementdata = GetAuthority($element); - $record= $elementdata if ($authid==$element); push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid); $cnt++; } @@ -94,9 +98,6 @@ if ($display_hierarchy){ 'loophierarchies' =>\@loophierarchies, ); } -else { - $record = GetAuthority( $authid ); -} my $count = CountUsage($authid);