Bug 26171 - Show biblionumber in Koha::Exceptions::Metadata::Invalid
Summary: Show biblionumber in Koha::Exceptions::Metadata::Invalid
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic record staging/import (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 23846
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-07 07:49 UTC by Fridolin Somers
Modified: 2021-02-11 22:33 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.02,20.05.08


Attachments
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid (2.65 KB, patch)
2020-08-07 08:10 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26171: adapt Koha/Exceptions.t (1.58 KB, patch)
2020-08-07 08:31 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid (2.71 KB, patch)
2020-11-27 17:20 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 26171: adapt Koha/Exceptions.t (1.64 KB, patch)
2020-11-27 17:21 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 26171: Show biblionumber in Koha::Exceptions::Metadata::Invalid (2.76 KB, patch)
2020-12-21 19:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26171: adapt Koha/Exceptions.t (1.69 KB, patch)
2020-12-21 19:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26171: (QA follow-up) Add table name and object type to message (1.92 KB, patch)
2020-12-21 19:25 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 🤭
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 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 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 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 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.