Bug 28741 - OAI ListSets does not correctly build resumption token
Summary: OAI ListSets does not correctly build resumption token
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on: 27584
Blocks:
  Show dependency treegraph
 
Reported: 2021-07-22 17:56 UTC by Nick Clemens (kidclamp)
Modified: 2022-12-12 21:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.03
Circulation function:


Attachments
Bug 28741: Fix use of resumption token params (1.91 KB, patch)
2021-07-22 18:02 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 28741: Fix use of resumption token params (1.96 KB, patch)
2021-07-22 19:54 UTC, David Nind
Details | Diff | Splinter Review
Bug 28741: Regression tests (2.43 KB, patch)
2021-08-02 12:37 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28741: Regression tests (3.05 KB, patch)
2021-08-02 13:19 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28741: Fix use of resumption token params (2.01 KB, patch)
2021-08-02 13:19 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28741: (follow-up) Silence warning (861 bytes, patch)
2021-08-02 13:19 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 28741: [20.11.x] Fix warning and position check (1.30 KB, patch)
2021-08-23 18:56 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2021-07-22 17:56:17 UTC
If you perform a list sets, you always get a resumption token, and it points to the same url always:
http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets

Turns out we are sending the wrong params to build the token
Comment 1 Nick Clemens (kidclamp) 2021-07-22 18:02:50 UTC
Created attachment 123063 [details] [review]
Bug 28741: Fix use of resumption token params

TO test:
 1 - Enable OAI-PMH server in Koha
 2 - Set OAI-PMH:MaxCount to 5
 3 - Define 6 sets in Admin->OAI sets configuration
    Can setSpec and setName to 1,2,3....
 4 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets
 5 - Click 'Show more'
 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0'
 7 - Apply patch
 8 - Restart all the things
 9 - Reload the ListSets URL above
10 - Click 'Show more'
11 - See the 6th set and note no 'Show more'
12 - Set OAI-PMH:MaxCount to 1
13 - Go to the base ListSets url again
14 - Confirm you can 'Show more' until you reach the end
Comment 2 Nick Clemens (kidclamp) 2021-07-22 18:04:33 UTC
Caused by bug 27584
Comment 3 David Nind 2021-07-22 19:54:25 UTC
Created attachment 123066 [details] [review]
Bug 28741: Fix use of resumption token params

TO test:
 1 - Enable OAI-PMH server in Koha
 2 - Set OAI-PMH:MaxCount to 5
 3 - Define 6 sets in Admin->OAI sets configuration
    Can setSpec and setName to 1,2,3....
 4 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets
 5 - Click 'Show more'
 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0'
 7 - Apply patch
 8 - Restart all the things
 9 - Reload the ListSets URL above
10 - Click 'Show more'
11 - See the 6th set and note no 'Show more'
12 - Set OAI-PMH:MaxCount to 1
13 - Go to the base ListSets url again
14 - Confirm you can 'Show more' until you reach the end

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Tomás Cohen Arazi (tcohen) 2021-08-02 12:37:12 UTC
Created attachment 123369 [details] [review]
Bug 28741: Regression tests

This patch adds regression tests for the behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi (tcohen) 2021-08-02 13:19:35 UTC
Created attachment 123382 [details] [review]
Bug 28741: Regression tests

This patch adds regression tests for the behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi (tcohen) 2021-08-02 13:19:39 UTC
Created attachment 123383 [details] [review]
Bug 28741: Fix use of resumption token params

TO test:
 1 - Enable OAI-PMH server in Koha
 2 - Set OAI-PMH:MaxCount to 5
 3 - Define 6 sets in Admin->OAI sets configuration
    Can setSpec and setName to 1,2,3....
 4 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListSets
 5 - Click 'Show more'
 6 - Keep seeing the same 5 - note the page says 'Results fetched -4-0'
 7 - Apply patch
 8 - Restart all the things
 9 - Reload the ListSets URL above
10 - Click 'Show more'
11 - See the 6th set and note no 'Show more'
12 - Set OAI-PMH:MaxCount to 1
13 - Go to the base ListSets url again
14 - Confirm you can 'Show more' until you reach the end

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi (tcohen) 2021-08-02 13:19:44 UTC
Created attachment 123384 [details] [review]
Bug 28741: (follow-up) Silence warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Jonathan Druart 2021-08-06 10:14:58 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 9 Kyle M Hall (khall) 2021-08-06 18:07:10 UTC
Pushed to 21.05.x for 21.05.03
Comment 10 Fridolin Somers 2021-08-11 20:01:09 UTC
Depends on Bug 27584 not in 20.11.x
Comment 11 Katrin Fischer 2021-08-11 20:26:21 UTC
I am not sure the depedency applied - I backported this to our 20.11 early after some testing and it applied nicely (and works)
Comment 12 Ere Maijala 2021-08-16 13:33:12 UTC
Sorry about breaking this and thanks for the fix.
Comment 13 Nick Clemens (kidclamp) 2021-08-23 18:56:57 UTC
Created attachment 124054 [details] [review]
Bug 28741: [20.11.x] Fix warning and position check
Comment 14 Nick Clemens (kidclamp) 2021-08-23 18:57:58 UTC
(In reply to Fridolin Somers from comment #10)
> Depends on Bug 27584 not in 20.11.x

The dependency affects the variable name change, the other parts of the patch set are still valid - we still show 'Show more' when at end of list and have a warning about the undef metadata prefix