Bug 26528 - Koha return no result if there's invalid records in Z39.50/SRU server reply
Summary: Koha return no result if there's invalid records in Z39.50/SRU server reply
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Didier Gautheron
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-24 08:11 UTC by Didier Gautheron
Modified: 2021-12-13 21:10 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11
Circulation function:


Attachments
Bug 26528: Z39.50/SRU ignore invalid replies (1.46 KB, patch)
2020-09-24 08:22 UTC, Didier Gautheron
Details | Diff | Splinter Review
Bug 26528: Z39.50/SRU ignore invalid replies (1.52 KB, patch)
2021-03-31 09:02 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 26528: Z39.50/SRU ignore invalid replies (1.54 KB, patch)
2021-04-16 13:25 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Gautheron 2020-09-24 08:11:16 UTC
When searching for authorities if an authorities server reply has invalid records none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.
 
Test plan:
1- Add BNF SRU
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed
Comment 1 Didier Gautheron 2020-09-24 08:22:32 UTC
Created attachment 110638 [details] [review]
Bug 26528: Z39.50/SRU ignore invalid replies

When searching for authorities if an authorities server reply has invalid records
none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error
confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.

To Test:
1- Add BNF SRU server
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed
Comment 2 Victor Grousset/tuxayo 2020-12-11 17:52:46 UTC
Hi :)
Please can you provide the coordinates of the BNF SRU server? Unfortunately, I don't have them.
Comment 4 Victor Grousset/tuxayo 2021-03-31 09:02:59 UTC
Created attachment 119033 [details] [review]
Bug 26528: Z39.50/SRU ignore invalid replies

When searching for authorities if an authorities server reply has invalid records
none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error
confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.

To Test:
1- Add BNF SRU server
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 5 Victor Grousset/tuxayo 2021-03-31 09:14:04 UTC
Thanks Didier, the SQL version is great, this allows me to add it to shared/custom.sql and have it loaded when starting my koha.

Anyway, it works :)
Comment 6 Kyle M Hall (khall) 2021-04-16 13:25:32 UTC
Created attachment 119733 [details] [review]
Bug 26528: Z39.50/SRU ignore invalid replies

When searching for authorities if an authorities server reply has invalid records
none are displayed.

At least french BNF SRU server doesn't fully follow norm and can return an error
confusing Koha protocol handler which then returns an empty MARC record.

This patch silently removed bogus records.

To Test:
1- Add BNF SRU server
2- Go to authorities page
3- Add an authority
4- Search for keyword(any) droits de l'homme
5- No result (Internal Server Error)
6- Apply patch
7- restart starman
8- redo 4
9- Many records are displayed

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Jonathan Druart 2021-04-16 14:30:54 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-04-22 14:34:10 UTC
Pushed to 20.11.x for 20.11.05
Comment 9 Victor Grousset/tuxayo 2021-04-25 20:47:50 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.Fixed info about backport to oldstable, 20.05