Closed (fixed)
Project:
Search configuration
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Aug 2008 at 04:31 UTC
Updated:
25 Sep 2008 at 04:17 UTC
Jump to comment: Most recent file
Comments
Comment #1
JacobSingh commented@RobertDouglass & @drunkenmonkey,
Can one of you guys take a look at this? I feel it is really important to foster adoption.
Best,
Jacob
Comment #2
robertdouglass commentedThe approach is good but I think it should be part of the http://drupal.org/project/search_config module. (Actually, I think it should be part of core).
Comment #3
robertdouglass commentedComment #4
pahariwalla commented1) Added option "Default Search" to Advanced search configuration. Presents radios - one for each module implementing hook_search (except search_config), setting new variable "search_config_default_search"
2) Modified hook_form_alter to present the appropriate tab on search results.
Comment #5
JacobSingh commentedThis is great! Works perfectly. Only one suggestion:
Improve the documentation inline on them form. Right now, it's a little sparse, it's a little hard to describe I suppose, but something a little more verbose might help. Really nice though!
Also, check for style things like spaces after commas, etc... It's not terribly important, but worth a scan
Comment #6
pahariwalla commentedHow's this? (it's in the attached patch)
Which tab on the search results will be presented by default. The standard Drupal installation defaults to node_search ("Content" tab). This option allows you to default to the "User" tab or any other tab from contributed search modules, e.g. Apachesolr which implements a tab called "Search" tab to display its results
Comment #7
JacobSingh commentedLooks good to me! I'm not rechecking the patch, but I assume it is fine. Any other reviewers?
Comment #8
canen commentedIt looks OK but I'll see if I can apply it later and do some actual testing.
Comment #9
robertdouglass commentedI think #base is a deprecated property:
Doesn't $form_id have the information you're looking for?
Comment #10
robertdouglass commentedFavored Drupal coding style is to use full-word variable names with underscores separating words:
should become
But really, that code can be rewritten:
becomes
And finally, I'd prefer this:
(added t(), as opposed to t($descriptions) later in the form)
Comment #11
robertdouglass commentedComment #12
robertdouglass commented@pahariwalla: FYI: http://api.drupal.org/api/function/drupal_map_assoc/5
Comment #13
pahariwalla commentedOnce again thanks Robert for taking the time and keeping all things groovy.
Re: #base .. good eye. Deprecated in Drupal 6 (http://drupal.org/node/144132#base ) .
I've changed the condition logic to use $form_id instead of $form['#base']
"search_theme_form" for search box form
"search_form" for search results form
It seems to work fine. Being new to Drupal , I'm a little concerned about a form name containing the word "theme".... (jacob helped me with this piece)
@JacobSingh: comments?
Also in the patch are suggested changes to the array variable naming/handling and $description string translation
Comment #14
pahariwalla commentedComment #15
canen commentedDid a quick test, on a mostly clean install, and things seem to work as expected. There is a possible minor usability issue though. The search block will use the assigned default search and depending on what that is the initial search results might be a little surprising as there is no way to indicate that you will be searching "users", for example, instead of "content" from the search block. This is even more evident if the default search is "user" and the person does not have access to search users. All search results return empty. I don't think it will be much of an issue in practice though.
I cleaned up the patch at a little but mostly for style fixes. I also removed the
$modvariable since it wasn't needed. If someone else could test and let me know how it goes I'll gladly commit it.Comment #16
pahariwalla commentedi'll look for your style fixes - much appreciated.
Re: user experience - good point. it can get even crazier, as described in #267833: Add Fallback to default drupal search option
Comment #17
JacobSingh commentedWorks great!
Comment #18
canen commentedFixed in #141753.
Thanks.
Comment #19
canen commentedNew release out with the feature added. Thanks again everyone.
Closing.
Comment #20
pahariwalla commentedMy pleasure. As I'm pretty new at Drupal, it sure feels nice to have a patch evaluated, accepted and now implemented. Now I think I'll give myself a pat on the back.
Great thanks to all involved and to you @canen for getting to this so quickly.