[Koha-patches] [PATCH] Fix for Bug 4886, missing 404 redirection on wrong biblionumber for MARC and ISBD details
Owen Leonard
oleonard at myacpl.org
Thu Jun 10 19:28:28 CEST 2010
---
opac/opac-ISBDdetail.pl | 5 ++++-
opac/opac-MARCdetail.pl | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl
index b4a4d3a..9b5c031 100755
--- a/opac/opac-ISBDdetail.pl
+++ b/opac/opac-ISBDdetail.pl
@@ -75,7 +75,10 @@ $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
my $marcflavour = C4::Context->preference("marcflavour");
my $record = GetMarcBiblio($biblionumber);
-
+if ( ! $record ) {
+ print $query->redirect("/cgi-bin/koha/errors/404.pl");
+ exit;
+}
# some useful variables for enhanced content;
# in each case, we're grabbing the first value we find in
# the record and normalizing it
diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl
index 132d5a6..fae749c 100755
--- a/opac/opac-MARCdetail.pl
+++ b/opac/opac-MARCdetail.pl
@@ -60,7 +60,10 @@ my $itemtype = &GetFrameworkCode($biblionumber);
my $tagslib = &GetMarcStructure( 0, $itemtype );
my $biblio = GetBiblioData($biblionumber);
my $record = GetMarcBiblio($biblionumber);
-
+if ( ! $record ) {
+ print $query->redirect("/cgi-bin/koha/errors/404.pl");
+ exit;
+}
# open template
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
--
1.7.0.4
More information about the Koha-patches
mailing list