Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Bug 23846 added a check for invalid MARCXML in search_for_data_inconsistencies.pl.
But the error message does not show the biblionumber of invalid biblio record.
Test plan:
1) Import a bibliographic record with invalid XML, you can add non printable characters, like 0x1F (CTRL-V 1F with vim)
2) Run misc/maintenance/search_for_data_inconsistencies.pl
3) Check you see correct biblionumber in error message :
Invalid data, cannot decode object (id=xxx, biblionumber=yyy, format=marcxml, schema=zzz, decoding_error=...
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b987412f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
f38943c7f5
commit
c097e91254
|
|
@ -72,9 +72,10 @@ sub record {
|
|||
chomp $marcxml_error;
|
||||
unless ($record) {
|
||||
Koha::Exceptions::Metadata::Invalid->throw(
|
||||
id => $self->id,
|
||||
format => $self->format,
|
||||
schema => $self->schema,
|
||||
id => $self->id,
|
||||
biblionumber => $self->biblionumber,
|
||||
format => $self->format,
|
||||
schema => $self->schema,
|
||||
decoding_error => $marcxml_error,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ use Exception::Class (
|
|||
'Koha::Exceptions::Metadata::Invalid' => {
|
||||
isa => 'Koha::Exceptions::Metadata',
|
||||
description => 'Invalid data',
|
||||
fields => ['id','format','schema', 'decoding_error']
|
||||
fields => ['id', 'biblionumber', 'format', 'schema', 'decoding_error']
|
||||
}
|
||||
);
|
||||
|
||||
|
|
@ -36,8 +36,8 @@ sub full_message {
|
|||
|
||||
unless ($msg) {
|
||||
if ( $self->isa('Koha::Exceptions::Metadata::Invalid') ) {
|
||||
$msg = sprintf( "Invalid data, cannot decode object (id=%s, format=%s, schema=%s, decoding_error='%s')",
|
||||
$self->id, $self->format, $self->schema, $self->decoding_error );
|
||||
$msg = sprintf( "Invalid data, cannot decode object (id=%s, biblionumber=%s, format=%s, schema=%s, decoding_error='%s')",
|
||||
$self->id, $self->biblionumber, $self->format, $self->schema, $self->decoding_error );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue