From 15c0e11a2ce1abbe6d244f7e23b18f4d91e410d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 6 May 2020 14:59:47 +0200 Subject: [PATCH] Bug 25279: Use another var name for the filter It prevents: * The screen to display "no city, create one" if we are searching for a string that does not return any results. * The list to display only the city we have just created Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- admin/cities.pl | 10 +++------- .../prog/en/includes/cities-admin-search.inc | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/admin/cities.pl b/admin/cities.pl index 03bce54d24..0688852246 100755 --- a/admin/cities.pl +++ b/admin/cities.pl @@ -27,7 +27,7 @@ use C4::Output; use Koha::Cities; my $input = new CGI; -my $city_name = $input->param('city_name') // q||; +my $city_name_filter = $input->param('city_name_filter') // q||; my $cityid = $input->param('cityid'); my $op = $input->param('op') || 'list'; my @messages; @@ -51,7 +51,6 @@ if ( $op eq 'add_form' ) { $template->param( city => $city, ); } elsif ( $op eq 'add_validate' ) { - my $cityid = $input->param('cityid'); my $city_name = $input->param('city_name'); my $city_state = $input->param('city_state'); my $city_zipcode = $input->param('city_zipcode'); @@ -102,15 +101,12 @@ if ( $op eq 'add_form' ) { } if ( $op eq 'list' ) { - my $filter = {}; - $filter->{city_name} = { -like => '%'.$city_name.'%' } - if $city_name; - $template->param( cities_count => Koha::Cities->search($filter)->count ); + $template->param( cities_count => Koha::Cities->search->count ); } $template->param( cityid => $cityid, - city_name_filter => $city_name, + city_name_filter => $city_name_filter, messages => \@messages, op => $op, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc index 16a35088ff..ffde9faf85 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc @@ -5,7 +5,7 @@ -- 2.39.5