Bug 35266: Fix biblio check in opac-MARCdetail
We should check before retrieving metadata. Test plan; Try /cgi-bin/koha/opac-MARCdetail?biblionumber=X Replace X by a not-existing biblionumber. Verify that you get a 404 error page. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> JD amended patch: Use ternary op Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
6a9b6a2e00
commit
54bdcaef66
1 changed files with 1 additions and 1 deletions
|
@ -92,8 +92,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
|
||||
my $patron = Koha::Patrons->find($loggedinuser);
|
||||
my $biblio = Koha::Biblios->find($biblionumber);
|
||||
my $record = $biblio->metadata->record;
|
||||
|
||||
my $record = $biblio ? $biblio->metadata->record : undef;
|
||||
if ( ! $record ) {
|
||||
print $query->redirect("/cgi-bin/koha/errors/404.pl");
|
||||
exit;
|
||||
|
|
Loading…
Reference in a new issue