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>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c3f0732eb7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
75e886e31e
commit
b7ed2e378a
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue