Bug 36438: Check object for calling metadata
Resolve: Can't call method "metadata" on an undefined value at catalogue/MARCdetail.pl line 93
The proceeding lines check for $record and respond appropriately.
Test plan:
Call catalogue/MARCdetail.pl with an unexisting biblionumber.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit a37ebc77b7
)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
3e0c3032b6
commit
1d45bf88a9
1 changed files with 2 additions and 1 deletions
|
@ -90,7 +90,8 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
);
|
||||
|
||||
my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio
|
||||
my $record = $biblio_object->metadata->record({ embed_items => 1 });
|
||||
my $record;
|
||||
$record = $biblio_object->metadata->record({ embed_items => 1 }) if $biblio_object;
|
||||
|
||||
if ( not defined $record ) {
|
||||
# biblionumber invalid -> report and exit
|
||||
|
|
Loading…
Reference in a new issue