Bugzilla – Attachment 128954 Details for
Bug 29736
Error when placing a hold for a club without members
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29736: Restore searching
Bug-29736-Restore-searching.patch (text/plain), 2.13 KB, created by
Katrin Fischer
on 2022-01-02 16:36:53 UTC
(
hide
)
Description:
Bug 29736: Restore searching
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-01-02 16:36:53 UTC
Size:
2.13 KB
patch
obsolete
>From cc7739edd79591e0241ecec95d35fbeb92087975 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 21 Dec 2021 10:49:56 -0300 >Subject: [PATCH] Bug 29736: Restore searching > >Without this patch, the list will always display all clubs. > >To test: >1. Have two clubs, with enrollemnts: > - Cthulhu fans > - The Shadow Out of Time fans >2. Search for the letter c >=> FAIL: You get both results >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Only Cthulhu is returned >5. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Clubs.pm | 8 +++----- > reserve/request.pl | 7 ++++++- > 2 files changed, 9 insertions(+), 6 deletions(-) > >diff --git a/Koha/Clubs.pm b/Koha/Clubs.pm >index 4acb64c9d9..5b89a23c1b 100644 >--- a/Koha/Clubs.pm >+++ b/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<Koha::Clubs> 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 }, > ] >diff --git a/reserve/request.pl b/reserve/request.pl >index 81dac34ed0..d9cec60a79 100755 >--- a/reserve/request.pl >+++ b/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; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29736
:
128760
|
128836
|
128837
|
128838
|
128953
| 128954 |
128955