From 8644a1165f19a18e2e2010f51a7f32597e08a6ee Mon Sep 17 00:00:00 2001 From: Shi Yao Wang Date: Fri, 23 Feb 2024 14:16:27 -0500 Subject: [PATCH] Bug 35916: Purchase suggestions bibliographic filter should be a "contains" search Make all bibliographic information fields filter do a contain match rather than an exact match Test plan: 1. Create a purchase suggestion with a multi-word title (e.g. one day in december) 1.1. Go to Acquisitions > Suggestions > New purchase suggestion 1.2. Enter a title (e.g. one day in december) 1.3. Click on Submit your suggestion 2. Search for one of the words in the title 2.1. In the "Filter by" section, click on Bibliographic information 2.2. In the title field, enter one of the words of the title (e.g. december) 2.3. Click Go --> No results 3. Apply the patch 4. Redo step 2 and notice there is now a valid result Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer (cherry picked from commit 3d7ea3bd99a0b6c68d7bcd763559d43910c4c9e7) Signed-off-by: Fridolin Somers --- suggestion/suggestion.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index cb6da835f3..4b00fa0056 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -424,6 +424,9 @@ if ($op=~/else/) { if $search_params->{$f} eq '__ANY__' || $search_params->{$f} eq ''; } + for my $bi (qw (title author isbn publishercode copyrightdate collectiontitle)) { + $search_params->{$bi} = { 'LIKE' => "%" . $search_params->{$bi} . "%" } if $search_params->{$bi}; + } $search_params->{archived} = 0 if !$filter_archived; my @suggestions = Koha::Suggestions->search_limited($search_params)->as_list; -- 2.39.5