Bugzilla – Attachment 20427 Details for
Bug 8887
Search preferences: Strange behaviour with exact matches (default instead of custom favicon used, displays to much results)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8887: only display desired result when doing exact syspref search
Bug-8887-only-display-desired-result-when-doing-ex.patch (text/plain), 2.26 KB, created by
Kyle M Hall (khall)
on 2013-08-16 16:12:49 UTC
(
hide
)
Description:
Bug 8887: only display desired result when doing exact syspref search
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-08-16 16:12:49 UTC
Size:
2.26 KB
patch
obsolete
>From 3175fbc7b70fda024c3a23986dba4f88a59e7b1a Mon Sep 17 00:00:00 2001 >From: Marc Veron <veron@veron.ch> >Date: Sun, 7 Oct 2012 19:54:44 +0200 >Subject: [PATCH] Bug 8887: only display desired result when doing exact syspref search > >This patch fixes an issue where entering the complete name of a system >preference when doing a syspref search in the staff interface resulted >in the display of *all* preferences belonging to the desired one's >module. > >Since providing a more specific search string should result in getting >back more specific results, the previous behavior was not intuitive. > >Test scenario: > >a) In sysprefs, do a search with partial match (e.g. intranetcolor) >-> Result shows one entry: intranetcolorstylesheet >b) Do an exact search. e.g. intranetcolorstylesheet >-> Result shows all Staff Client preferences > >Apply patch, test again. Now b) behaves like a). > >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Passes koha-qa.pl, works as advertised. >--- > admin/preferences.pl | 10 ++++------ > 1 files changed, 4 insertions(+), 6 deletions(-) > >diff --git a/admin/preferences.pl b/admin/preferences.pl >index db91e76..09d648f 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -216,12 +216,10 @@ sub SearchPrefs { > > foreach my $piece ( @$line ) { > if ( ref( $piece ) eq 'HASH' ) { >- if ( !$piece->{'pref'} ){ next; } >- if ( $piece->{'pref'} =~ /^$searchfield$/i ) { >- my ( undef, $LINES ) = TransformPrefsToHTML( $data, $searchfield ); >- >- return { search_jumped => 1, tab => $tab_name, tab_title => $title, LINES => $LINES }; >- } elsif ( matches( $piece->{'pref'}, \@terms) ) { >+ if ( !$piece->{'pref'} ){ >+ next; >+ } >+ if ( matches( $piece->{'pref'}, \@terms) ) { > $matched = 1; > } elsif ( ref( $piece->{'choices'} ) eq 'HASH' && grep( { $_ && matches( $_, \@terms ) } values( %{ $piece->{'choices'} } ) ) ) { > $matched = 1; >-- >1.7.2.5
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 8887
:
12724
|
12725
|
12726
|
20278
| 20427