Bug 29484 - ListSets doesn't return noSetHierarchy when appropriate
Summary: ListSets doesn't return noSetHierarchy when appropriate
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 21102
  Show dependency treegraph
 
Reported: 2021-11-15 12:50 UTC by Tomás Cohen Arazi
Modified: 2021-11-25 08:26 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29484: Regression tests (1.91 KB, patch)
2021-11-15 12:55 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29484: Make ListSets return noSetHierarchy when no sets defined (1.50 KB, patch)
2021-11-15 12:55 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 29484: Regression tests (1.91 KB, patch)
2021-11-25 08:26 UTC, David Nind
Details | Diff | Splinter Review
Bug 29484: Make ListSets return noSetHierarchy when no sets defined (1.55 KB, patch)
2021-11-25 08:26 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 Tomás Cohen Arazi 2021-11-15 12:50:51 UTC
To reproduce:
$ cpanm HTTP::OAIPMH::Validator
$ PERL5LIB=/root/.local/share/.cpan/build/HTTP-OAIPMH-Validator-1.06-0/lib perl /root/.local/share/.cpan/build/HTTP-OAIPMH-Validator-1.06-0/examples/oaipmh-validator.pl http://kohadev.myDNSname.org:8080/cgi-bin/koha/oai.pl

=> FAIL: There are several errors, some reported under the bug 21102 umbrella
=> FAIL: This error wasn't reported before:

FAIL:    Failed to extract any setSpec elements from ListSets but did not find an exception message. If sets are not supported by the repository then the ListSets response must be the noSetHierarchy error. See <http://www.openarchives.org/OAI/2.0/openarchivesprotocol.htm#ListSets>.
Comment 1 Tomás Cohen Arazi 2021-11-15 12:55:20 UTC
Created attachment 127637 [details] [review]
Bug 29484: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi 2021-11-15 12:55:24 UTC
Created attachment 127638 [details] [review]
Bug 29484: Make ListSets return noSetHierarchy when no sets defined

This simple patch makes our OAI-PMH server return the appropriate error
code when no sets are defined.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ t/db_dependent/OAI/Server.t
=> FAIL: Tests fail. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! YAY!
5. Sign off :-D

Bonus: you can check with the tool mentioned on the bug report, that
the error is gone. No sets need to be defined.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 David Nind 2021-11-25 08:26:15 UTC
Created attachment 127995 [details] [review]
Bug 29484: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 David Nind 2021-11-25 08:26:19 UTC
Created attachment 127996 [details] [review]
Bug 29484: Make ListSets return noSetHierarchy when no sets defined

This simple patch makes our OAI-PMH server return the appropriate error
code when no sets are defined.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ t/db_dependent/OAI/Server.t
=> FAIL: Tests fail. Boo!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! YAY!
5. Sign off :-D

Bonus: you can check with the tool mentioned on the bug report, that
the error is gone. No sets need to be defined.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: David Nind <david@davidnind.com>