]> git.koha-community.org Git - koha.git/commit
Bug 29484: Make ListSets return noSetHierarchy when no sets defined
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 15 Nov 2021 12:52:15 +0000 (09:52 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 17 Dec 2021 19:53:46 +0000 (19:53 +0000)
commit7a9298f08e8aaed340de971d0a5708ae8e91cced
tree34b54049b917418da3fcc71dc046ff378cd35a3c
parenteac209998f440db044eaa75a94e351dd70542e3a
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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit abe9abf47083d26300a4e09100ba362e6facf6dc)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Koha/OAI/Server/ListSets.pm