Bug 29736: Don't return empty clubs
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Dec 2021 14:14:56 +0000 (15:14 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 14 Jan 2022 02:37:33 +0000 (16:37 -1000)
commitf86243fb5ca9edbbbcb39cc34df3650db7e1ac5e
tree6c2dce458a3b80e4819553586ec3ac74deb44974
parentcdf19f8ed69d4fb0cf44fe3b70e7e5bce2dd0513
Bug 29736: Don't return empty clubs

There is an error when placing a hold for a club without members:
Uncaught TypeError: err.responseJSON.error is undefined

It seems that we should remove clubs without members from the search.

Test plan:
Create 1 club xx with 2 patrons
Create 1 club xxx with 1 patron and cancel their enrolment
Create 1 club xxxx without patron

Place a hold for club "x", only the first one should be returned with
this patch.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Clubs.pm
reserve/request.pl
t/db_dependent/Clubs.t