Bug 26171

Summary: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: MARC Bibliographic record staging/importAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, caroline.cyr-la-rose, jonathan.druart, nick, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08
Circulation function:
Bug Depends on: 23846    
Bug Blocks:    
Attachments: Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Bug 26171: adapt Koha/Exceptions.t
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Bug 26171: adapt Koha/Exceptions.t
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Bug 26171: adapt Koha/Exceptions.t
Bug 26171: (QA follow-up) Add table name and object type to message

Description Fridolin Somers 2020-08-07 07:49:56 UTC
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.
Comment 1 Fridolin Somers 2020-08-07 08:10:08 UTC
Created attachment 107941 [details] [review]
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=...
Comment 2 Jonathan Druart 2020-08-07 08:18:56 UTC
You certainly need to adjust t/Koha/Exceptions.t
Comment 3 Fridolin Somers 2020-08-07 08:31:51 UTC
Created attachment 107944 [details] [review]
Bug 26171: adapt Koha/Exceptions.t
Comment 4 Fridolin Somers 2020-08-07 08:34:13 UTC
(In reply to Jonathan Druart from comment #2)
> You certainly need to adjust t/Koha/Exceptions.t

Of course, thanks ﷐[U+1F92D]﷑
Comment 5 Victor Grousset/tuxayo 2020-11-27 17:20:59 UTC
Created attachment 114050 [details] [review]
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>
Comment 6 Victor Grousset/tuxayo 2020-11-27 17:21:03 UTC
Created attachment 114051 [details] [review]
Bug 26171: adapt Koha/Exceptions.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2020-11-27 17:26:46 UTC
It works!

also, QA script ok
Comment 8 Nick Clemens (kidclamp) 2020-12-21 19:25:33 UTC
Created attachment 114575 [details] [review]
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>
Comment 9 Nick Clemens (kidclamp) 2020-12-21 19:25:36 UTC
Created attachment 114576 [details] [review]
Bug 26171: adapt Koha/Exceptions.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Nick Clemens (kidclamp) 2020-12-21 19:25:38 UTC
Created attachment 114577 [details] [review]
Bug 26171: (QA follow-up) Add table name and object type to message

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Nick Clemens (kidclamp) 2020-12-21 19:26:35 UTC
Added a follow-up to clarify which object threw the exception and explain where the id comes from - feel free to drop if you disagree RM
Comment 12 Fridolin Somers 2020-12-22 09:16:21 UTC
(In reply to Nick Clemens from comment #11)
> Added a follow-up to clarify which object threw the exception and explain
> where the id comes from - feel free to drop if you disagree RM

+1
Comment 13 Jonathan Druart 2021-01-04 13:10:24 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 14 Fridolin Somers 2021-01-07 13:47:33 UTC
Pushed to 20.11.x for 20.11.02
Comment 15 Andrew Fuerste-Henry 2021-01-10 20:50:03 UTC
Pushed to 20.05.x for 20.05.08
Comment 16 Victor Grousset/tuxayo 2021-01-18 18:11:32 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.