View | Details | Raw Unified | Return to bug 29736
Collapse All | Expand All

(-)a/Koha/Clubs.pm (-5 / +3 lines)
Lines 87-93 sub get_enrollable { Link Here
87
87
88
=head3 filter_out_empty
88
=head3 filter_out_empty
89
89
90
    Remove clubs without current enrollments.
90
    my $filtered_rs = $clubs_rs->filter_out_empty;
91
92
Return a new I<Koha::Clubs> resultset, containing only clubs with current enrollments.
91
93
92
=cut
94
=cut
93
95
Lines 96-105 sub filter_out_empty { Link Here
96
    return $self->search(
98
    return $self->search(
97
        {
99
        {
98
            -and => [
100
            -and => [
99
                [
100
                    { name        => { like => '%x%' } },
101
                    { description => { like => '%x%' } },
102
                ],
103
                { 'club_enrollments.club_id'       => { '!=' => undef } },
101
                { 'club_enrollments.club_id'       => { '!=' => undef } },
104
                { 'club_enrollments.date_canceled' => undef },
102
                { 'club_enrollments.date_canceled' => undef },
105
            ]
103
            ]
(-)a/reserve/request.pl (-2 / +6 lines)
Lines 165-171 if($findclub) { Link Here
165
    if( $club ) {
165
    if( $club ) {
166
        $club_hold = $club->id;
166
        $club_hold = $club->id;
167
    } else {
167
    } else {
168
        my @clubs = Koha::Clubs->search->filter_out_empty;
168
        my @clubs = Koha::Clubs->search(
169
            [
170
                { name        => { like => '%' . $findclub . '%' } },
171
                { description => { like => '%' . $findclub . '%' } }
172
            ]
173
        )->filter_out_empty->as_list;
169
174
170
        if( scalar @clubs == 1 ) {
175
        if( scalar @clubs == 1 ) {
171
            $club_hold = $clubs[0]->id;
176
            $club_hold = $clubs[0]->id;
172
- 

Return to bug 29736