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>.
Created attachment 127637 [details] [review] Bug 29484: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
Created attachment 127995 [details] [review] Bug 29484: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
I will amend the patch with - ) unless scalar @{$sets} > 0; + ) unless @$sets;
$ cpanm HTTP::OAIPMH::Validator This fails for me
Created attachment 128169 [details] [review] Bug 29484: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 128170 [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> JD amended patch - ) unless scalar @{$sets} > 0; + ) unless @$sets; Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #5) > I will amend the patch with > - ) unless scalar @{$sets} > 0; > + ) unless @$sets; Why? I prefer what I wrote and have been adding it all the time. If it makes more sense to do it your way, we should make sure it is in the guidelines. I still prefer to have the reader understand we are talking about the list size.
(In reply to Tomás Cohen Arazi from comment #9) > (In reply to Jonathan Druart from comment #5) > > I will amend the patch with > > - ) unless scalar @{$sets} > 0; > > + ) unless @$sets; > > Why? I prefer what I wrote and have been adding it all the time. If it makes > more sense to do it your way, we should make sure it is in the guidelines. I > still prefer to have the reader understand we are talking about the list > size. ok, reverted. @$sets does exactly what you are describing, just less verbose. Nevermind.
(In reply to Jonathan Druart from comment #10) > (In reply to Tomás Cohen Arazi from comment #9) > > (In reply to Jonathan Druart from comment #5) > > > I will amend the patch with > > > - ) unless scalar @{$sets} > 0; > > > + ) unless @$sets; > > > > Why? I prefer what I wrote and have been adding it all the time. If it makes > > more sense to do it your way, we should make sure it is in the guidelines. I > > still prefer to have the reader understand we are talking about the list > > size. > > ok, reverted. > > @$sets does exactly what you are describing, just less verbose. Nevermind. I like your approach, is more Perl-ish, and we should adopt it as a guideline.
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.01
Pushed to 21.05.x for 21.05.08
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.