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 commita37ebc77b7
) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit1d45bf88a9
) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
b9d4408648
commit
8965898873
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 $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 ) {
|
if ( not defined $record ) {
|
||||||
# biblionumber invalid -> report and exit
|
# biblionumber invalid -> report and exit
|
||||||
|
|
Loading…
Reference in a new issue