Bug 30913

Summary: Show itemtype notforloan with ILS-DI service GetRecords
Product: Koha Reporter: David Cook <dcook>
Component: Web servicesAssignee: David Cook <dcook>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: david, m.de.rooy, mathsabypro
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30636
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Discovery services like EBSCO's EDS use the GetRecords ILS-DI service, but the "notforloan" only includes item-level notforloan and not item-type notforloan. This fixes this, so that if the item type is set as not for loan, ILS-DI GetRecords responses will return <notforloan>1</notforloan>.
Version(s) released in:
Attachments: Bug 30913: Show notforloan from itemtype for ILS-DI GetRecords
Bug 30913: Show notforloan from itemtype for ILS-DI GetRecords

Description David Cook 2022-06-07 00:33:14 UTC
Discovery services like EBSCO's EDS use the GetRecords ILS-DI service, but the "notforloan" there only includes item-level notforloan and not item-type notforloan.

In theory, they should use GetAvailability for availability but I can see why they'd use GetRecords since it has so much more information and that way they can do 1 API call instead of 2.
Comment 1 David Cook 2022-06-07 00:34:07 UTC Comment hidden (obsolete)
Comment 2 David Cook 2022-11-07 22:55:14 UTC Comment hidden (obsolete)
Comment 3 David Cook 2023-08-14 00:47:47 UTC
Created attachment 154401 [details] [review]
Bug 30913: Show notforloan from itemtype for ILS-DI GetRecords

This patch sets notforloan for an item if its itemtype is set
to notforloan, when creating the ILS-DI GetRecords response.

To test:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
3. Enable the ILS-DI API
4. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
5. Note the "notforloan" is 0
6. Go to http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK
7. Checkbox the "Not for loan" and save
8. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
9. Note the "notforloan" is 1
Comment 4 David Nind 2023-08-26 22:31:46 UTC
Created attachment 154861 [details] [review]
Bug 30913: Show notforloan from itemtype for ILS-DI GetRecords

This patch sets notforloan for an item if its itemtype is set
to notforloan, when creating the ILS-DI GetRecords response.

To test:
0. Apply the patch
1. koha-plack --restart kohadev
2. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI
3. Enable the ILS-DI API
4. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
5. Note the "notforloan" is 0
6. Go to http://localhost:8081/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK
7. Checkbox the "Not for loan" and save
8. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29
9. Note the "notforloan" is 1

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Marcel de Rooy 2023-09-29 07:28:27 UTC
Please add a test in t/db_dependent/ILSDI_Services.t