Bug 29686 - Adapt OverDrive for new fulfillment API
Summary: Adapt OverDrive for new fulfillment API
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2021-12-13 13:08 UTC by Nick Clemens
Modified: 2022-02-24 22:32 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.11


Attachments
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive (4.29 KB, patch)
2021-12-13 13:13 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive (5.46 KB, patch)
2021-12-13 19:25 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive (5.52 KB, patch)
2021-12-14 16:12 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive (5.58 KB, patch)
2021-12-16 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive (5.63 KB, patch)
2022-01-09 11:10 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2021-12-13 13:08:19 UTC
Background: http://developer.overdrive.com/overdrive-api-notices/01-sep-2021-coming-soon-changes-to-overdrive-checkouts-api

Basically, once a title is checked out, we need to make a call to get the 'fulfillment' URL

The new API endpoint returns a redirect request, but we can also get the URL back and refer the patron
Comment 1 Nick Clemens 2021-12-13 13:13:42 UTC
Created attachment 128457 [details] [review]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all checked out items
and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account' tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however, magazines may not as each
checkout has a unique 'reserve id' and the 'parent' id is not checked in our current code
Comment 2 Nick Clemens 2021-12-13 19:25:09 UTC
Created attachment 128481 [details] [review]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all checked out items
and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account' tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however, magazines may not as each
checkout has a unique 'reserve id' and the 'parent' id is not checked in our current code
Comment 3 Andrew Fuerste-Henry 2021-12-14 16:12:09 UTC
Created attachment 128514 [details] [review]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all checked out items
and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account' tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however, magazines may not as each
checkout has a unique 'reserve id' and the 'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Owen Leonard 2021-12-16 15:13:57 UTC
Created attachment 128628 [details] [review]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Katrin Fischer 2022-01-09 11:09:34 UTC
I can't test this with Overdrive, but trusting Nick, Andrew and Owen have tested this. Code changes pass QA tools and are limited to the Overdrive files so there should be no side-effects on other parts of the OPAC.
Comment 6 Katrin Fischer 2022-01-09 11:10:57 UTC
Created attachment 129233 [details] [review]
Bug 29686: Adapt Koha to use new fulfillment API for OverDrive

This patch modifies the checkout_download_url routine in
WebSerivce::ILS::OverDrive::Patron

We now directly hit the fulfillment endpoint with redirects disabled
and fetch the URL

The overdrive.js is modified to use a single 'Get item' button for all
checked out items and to refer to the fulfillment page

To test:
1 - Enable all OverDrive system preferences
2 - Search on opac and confirm OD results returned
3 - Checkout an item
4 - Confirm you have the new 'Get item' button on 'OverDrive account'
    tab on opac-user.pl
5 - Confirm the 'Get item' button works

NOTE:
Most items will also show the 'Get item' button in results, however,
magazines may not as each checkout has a unique 'reserve id' and the
'parent' id is not checked in our current code

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Fridolin Somers 2022-01-28 21:13:12 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 8 Kyle M Hall 2022-02-07 13:12:53 UTC
Pushed to 21.11.x for 21.11.03
Comment 9 Andrew Fuerste-Henry 2022-02-21 15:08:03 UTC
Pushed to 21.05.x for 21.05.11
Comment 10 Victor Grousset/tuxayo 2022-02-24 22:32:05 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.