Bug 35104: Guard Koha::Exceptions::Metadata::Invalid::full_message against undef fields
full_message() interpolated id/biblionumber/format/schema/decoding_error directly into a sprintf without checking definedness, producing Perl warnings whenever one of them is unset (e.g. a new, not-yet-stored metadata object with no id yet). Signed-off-by: Baptiste Bayche <baptiste.bayche@inlibro.com> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Sponsored-by: OpenFifth Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
0490204f7b
commit
50b0ba401b
|
|
@ -40,7 +40,8 @@ sub full_message {
|
|||
if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
|
||||
$msg = sprintf(
|
||||
"Invalid data, cannot decode metadata object (biblio_metadata.id=%s, biblionumber=%s, format=%s, schema=%s, decoding_error='%s')",
|
||||
$self->id, $self->biblionumber, $self->format, $self->schema, $self->decoding_error
|
||||
$self->id // '', $self->biblionumber // '', $self->format // '', $self->schema // '',
|
||||
$self->decoding_error // ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue