Bugzilla – Attachment 174945 Details for
Bug 37427
Searching for an empty string for clubs in an item's hold tab is not allowed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37427: Fix club search to display all clubs when search field is empty, consistent with patron search behavior
Bug-37427-Fix-club-search-to-display-all-clubs-whe.patch (text/plain), 3.74 KB, created by
Lucas Gass (lukeg)
on 2024-11-22 18:47:42 UTC
(
hide
)
Description:
Bug 37427: Fix club search to display all clubs when search field is empty, consistent with patron search behavior
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-11-22 18:47:42 UTC
Size:
3.74 KB
patch
obsolete
>From 363acb8063d053e5985dbd7f6f181aa8b97c002e Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Mon, 22 Jul 2024 20:04:18 +0000 >Subject: [PATCH] Bug 37427: Fix club search to display all clubs when search > field is empty, consistent with patron search behavior > >To test: >1) Create multiple patron clubs >2) Find a bib >3) Click Holds, then Clubs >4) Without entering any text, press the search button >5) Note that the list of clubs is not shown. >6) Apply patch and restart_all >7) Press the search button again, the entire list of clubs should be shown. >8) Ensure original search functionality still works > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../prog/en/modules/reserve/request.tt | 1 + > reserve/request.pl | 36 +++++++++++-------- > 2 files changed, 23 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 2fcc09479f..06d171a984 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -283,6 +283,7 @@ > <form id="holds_clubsearch" action="request.pl" method="get"> > <div class="hint">Enter club ID or partial name:</div> > <input type="text" size="40" id="club" class="focus" name="findclub" autocomplete="off" /> >+ <input type="hidden" name="form_submitted" value="1" /> > <input type="submit" class="btn btn-primary" value="Search" /> > [% FOREACH biblionumber IN biblionumbers %] > <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/> >diff --git a/reserve/request.pl b/reserve/request.pl >index b19fa3b868..b9a3182d7c 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -89,6 +89,7 @@ my $messages; > my $exceeded_maxreserves; > my $exceeded_holds_per_record; > my @failed_holds = $input->multi_param('failed_holds'); >+my $form_submitted = $input->param('form_submitted'); > > my $op = $input->param('op') || q{}; > >@@ -150,22 +151,29 @@ if ($findborrower) { > $borrowernumber_hold = $patron->borrowernumber if $patron; > } > >-if($findclub) { >- my $club = Koha::Clubs->find( { name => $findclub } ); >- if( $club ) { >- $club_hold = $club->id; >- } else { >- my @clubs = Koha::Clubs->search( [ >- { name => { like => '%'.$findclub.'%' } }, >- { description => { like => '%'.$findclub.'%' } } >- ] )->as_list; >- if( scalar @clubs == 1 ) { >- $club_hold = $clubs[0]->id; >- } elsif ( @clubs ) { >- $template->param( clubs => \@clubs ); >+if ($form_submitted) { >+ if ($findclub) { >+ my $club = Koha::Clubs->find( { name => $findclub } ); >+ if ($club) { >+ $club_hold = $club->id; > } else { >- $messageclub = "'$findclub'"; >+ my @clubs = Koha::Clubs->search( >+ [ >+ { name => { like => '%' . $findclub . '%' } }, >+ { description => { like => '%' . $findclub . '%' } } >+ ] >+ )->as_list; >+ if ( scalar @clubs == 1 ) { >+ $club_hold = $clubs[0]->id; >+ } elsif (@clubs) { >+ $template->param( clubs => \@clubs ); >+ } else { >+ $messageclub = "'$findclub'"; >+ } > } >+ } else { >+ my @clubs = Koha::Clubs->search()->as_list; >+ $template->param( clubs => \@clubs ); > } > } > >-- >2.39.2
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 37427
:
169382
|
169385
| 174945