Bug 26528

Summary: Koha return no result if there's invalid records in Z39.50/SRU server reply
Product: Koha Reporter: Didier Gautheron <didier.gautheron>
Component: Z39.50 / SRU / OpenSearch ServersAssignee: Didier Gautheron <didier.gautheron>
Status: CLOSED FIXED QA Contact: Kyle M Hall <kyle>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle, m.de.rooy, victor
Version: Main   
Hardware: All   
OS: All   
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
Attachments: Bug 26528: Z39.50/SRU ignore invalid replies
Bug 26528: Z39.50/SRU ignore invalid replies
Bug 26528: Z39.50/SRU ignore invalid replies

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 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