@@ -, +, @@ - Cthulhu fans - The Shadow Out of Time fans --- Koha/Clubs.pm | 8 +++----- reserve/request.pl | 7 ++++++- 2 files changed, 9 insertions(+), 6 deletions(-) --- a/Koha/Clubs.pm +++ a/Koha/Clubs.pm @@ -87,7 +87,9 @@ sub get_enrollable { =head3 filter_out_empty - Remove clubs without current enrollments. + my $filtered_rs = $clubs_rs->filter_out_empty; + +Return a new I resultset, containing only clubs with current enrollments. =cut @@ -96,10 +98,6 @@ sub filter_out_empty { return $self->search( { -and => [ - [ - { name => { like => '%x%' } }, - { description => { like => '%x%' } }, - ], { 'club_enrollments.club_id' => { '!=' => undef } }, { 'club_enrollments.date_canceled' => undef }, ] --- a/reserve/request.pl +++ a/reserve/request.pl @@ -165,7 +165,12 @@ if($findclub) { if( $club ) { $club_hold = $club->id; } else { - my @clubs = Koha::Clubs->search->filter_out_empty; + my @clubs = Koha::Clubs->search( + [ + { name => { like => '%' . $findclub . '%' } }, + { description => { like => '%' . $findclub . '%' } } + ] + )->filter_out_empty->as_list; if( scalar @clubs == 1 ) { $club_hold = $clubs[0]->id; --