Bug 11329: Check for MARC record existence in opac-showmarc
Instead of just running as_formatted, check if GetMarcBiblio returned a reference. If you e.g. did not pass an id, return 404 instead of 500. Consistent with opac-export.pl Test plan: [1] Run opac-showmarc.pl with valid biblionumber in id parameter. [2] Remove id parameter from URL. You should get a 404 now. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
8c648bddf1
commit
80bcbd7989
1 changed files with 4 additions and 0 deletions
|
@ -54,6 +54,10 @@ if ($importid) {
|
||||||
else {
|
else {
|
||||||
$record =GetMarcBiblio($biblionumber);
|
$record =GetMarcBiblio($biblionumber);
|
||||||
}
|
}
|
||||||
|
if(!ref $record) {
|
||||||
|
print $input->redirect("/cgi-bin/koha/errors/404.pl");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($view eq 'card' || $view eq 'html') {
|
if ($view eq 'card' || $view eq 'html') {
|
||||||
my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
|
my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber);
|
||||||
|
|
Loading…
Reference in a new issue