Bugzilla – Attachment 158977 Details for
Bug 35266
opac-MARCdetail: Can't call method "metadata" on an undefined value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35266: Fix biblio check in opac-MARCdetail
Bug-35266-Fix-biblio-check-in-opac-MARCdetail.patch (text/plain), 1.22 KB, created by
Jonathan Druart
on 2023-11-15 10:26:22 UTC
(
hide
)
Description:
Bug 35266: Fix biblio check in opac-MARCdetail
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-11-15 10:26:22 UTC
Size:
1.22 KB
patch
obsolete
>From e443aa450eb067087316d6d2f77ca2dbd88c5322 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 6 Nov 2023 13:11:49 +0000 >Subject: [PATCH] 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> >--- > opac/opac-MARCdetail.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index 9b85bbbe1ed..0829341d731 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -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; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35266
:
158518
|
158576
| 158977