Bugzilla – Attachment 91293 Details for
Bug 23248
opac-ISBDdetail.pl dies on invalid biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Bug-23248-Avoid-opac-ISBDdetailpl-breaking-on-inva.patch (text/plain), 1.62 KB, created by
Mark Tompsett
on 2019-07-04 17:31:48 UTC
(
hide
)
Description:
Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid biblionumber
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2019-07-04 17:31:48 UTC
Size:
1.62 KB
patch
obsolete
>From c5f8eb8e5949e479d7afc5d3bfb92ecd27c36962 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 1 Jul 2019 15:52:02 -0300 >Subject: [PATCH] Bug 23248: Avoid opac-ISBDdetail.pl breaking on invalid > biblionumber > >This patch makes opac-ISBDdetail.pl redirect to a 404 page (as it >should) in the event of a bad biblionumber passed. > >To test: >- Open your browser on a known record detail page (OPAC) >- Switch to the ISBD view >=> SUCCESS: It shows >- Alter the biblionumber on the URL into an obviously non-existent >biblionumber (e.g. very high value) >=> FAIL: Internal errors are shown >- Apply this patch >- Reload the bad biblionumber ISBD view >=> SUCCESS: Browser is redirected to the 404 page as it should >- Sign off :-=> FAIL: Internal errors are shown >- Apply this patch >- Reload the bad biblionumber ISBD view >=> SUCCESS: Browser is redirected to the 404 page as it should >- Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > opac/opac-ISBDdetail.pl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index e4a0b3fcad..4305d8c483 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -76,8 +76,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >- > my $biblio = Koha::Biblios->find( $biblionumber, { prefetch => [ 'metadata', 'items' ] } ); >+unless ( $biblio ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); >+ exit; >+} >+ > my $patron = Koha::Patrons->find($loggedinuser); > > my $opachiddenitems_rules; >-- >2.11.0
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 23248
:
91156
|
91157
|
91293
|
91311
|
91312