Bug 42102 - Z39.50 ISBN sometimes fails when right truncation provided
Summary: Z39.50 ISBN sometimes fails when right truncation provided
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Z39.50 / SRU / OpenSearch Servers (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-16 03:35 UTC by David Cook
Modified: 2026-03-16 06:18 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Crowdfunding committed: 0
Crowdfunding contact:
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 42102: Try with and without right truncation for ISBN (1.60 KB, patch)
2026-03-16 03:39 UTC, David Cook
Details | Diff | Splinter Review
Bug 42102: Try with and without right truncation for ISBN (1.65 KB, patch)
2026-03-16 06:17 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2026-03-16 03:35:48 UTC
I've noticed that the Z39.50 search for ISBN no longer works for the Library of Congress.

It appears that their support for the @attr 5=1 right truncation has changed. If you provide the full ISBN, it will fail. If you provide a partial, it will succeed.

The way to work around this is to try both with and without truncation. (Note that places like the National Library of Medicine in the USA will let you provide @attr 5=1 but it doesn't actually perform the right truncation on your ISBN search.)
Comment 1 David Cook 2026-03-16 03:39:35 UTC
Created attachment 195381 [details] [review]
Bug 42102: Try with and without right truncation for ISBN

This change widens the ISBN search to try with and without right
truncation as different Z39.50 servers appear to handle this
differently. Some will ignore it and others will fail to return
a result if a full ISBN is provided (like with the Library of Congress
currently)

Test plan:
0. Do not apply the patch yet
1. Log into koha-testing-docker
2. Do a ISBN search for 9780879933913 for the Library of Congress
(Note to use the Z39.50 and NOT the SRU)
3. Note that it doesn't return any results

4. Apply the patch and koha-plack --restart kohadev

5. Do a ISBN search for 9780879933913 for the Library of Congress
(Note to use the Z39.50 and NOT the SRU)
6. Note that you get a result
7. Do a ISBN search for 978087993391 for the Library of Congress
8. Note that you get a result with the partial ISBN
Comment 2 David Nind 2026-03-16 06:17:45 UTC
Created attachment 195382 [details] [review]
Bug 42102: Try with and without right truncation for ISBN

This change widens the ISBN search to try with and without right
truncation as different Z39.50 servers appear to handle this
differently. Some will ignore it and others will fail to return
a result if a full ISBN is provided (like with the Library of Congress
currently)

Test plan:
0. Do not apply the patch yet
1. Log into koha-testing-docker
2. Do a ISBN search for 9780879933913 for the Library of Congress
(Note to use the Z39.50 and NOT the SRU)
3. Note that it doesn't return any results

4. Apply the patch and koha-plack --restart kohadev

5. Do a ISBN search for 9780879933913 for the Library of Congress
(Note to use the Z39.50 and NOT the SRU)
6. Note that you get a result
7. Do a ISBN search for 978087993391 for the Library of Congress
8. Note that you get a result with the partial ISBN

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2026-03-16 06:18:48 UTC
Occasionally getting this error after the patch:

- Present request out of range (ref. 13) for LIBRARY OF CONGRESS result 1