After configuring search and unchecking "user 1" restriction, user 1 no longer sees the keyword text input on the search form.
The only thing on the form is a "advanced search" fieldset and "advanced search" button:

Here are my search configs:
content_node_search_config: Array
(
[forms] => Array
(
[toggle_forms] => 1
[move_keyword_search] => 0
[advanced_populate] => 0
[remove_containing_wrapper] => remove
[advanced_expand] => default
)
[fields] => Array
(
[containing_any] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[containing_phrase] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[containing_none] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[types] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
[filter] => Array
(
[blog_post_update] => 0
[campaign] => 0
[event] => 0
[landing_page] => 0
[listing_page] => 0
[member_story] => 0
[page] => 0
[resource] => 0
)
[groupings] => Array
(
)
)
[category] => Array
(
[remove] => 0
[roles] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[language] => Array
(
[remove] => 0
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
)
[results] => Array
(
[limit] => 10
)
[restrictions] => Array
(
[admin_bypass] => 0
)
)
search_active_modules: Array
(
[node] => node
[user] => 0
)
search_config: Array
(
[forms] => Array
(
[toggle_forms] => 1
[move_keyword_search] => 0
[advanced_populate] => 0
[remove_containing_wrapper] => remove
[advanced_expand] => default
)
[fields] => Array
(
[containing_any] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[containing_phrase] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[containing_none] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[types] => Array
(
[remove] => 1
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
[filter] => Array
(
[blog_post_update] => 0
[campaign] => 0
[event] => 0
[landing_page] => 0
[listing_page] => 0
[member_story] => 0
[page] => 0
[resource] => 0
)
[groupings] => Array
(
)
)
[category] => Array
(
[remove] => 0
[roles] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
[language] => Array
(
[remove] => 0
[roles] => Array
(
[1] => 0
[2] => 0
[3] => 0
[4] => 0
)
)
)
[results] => Array
(
[limit] => 10
)
[restrictions] => Array
(
[admin_bypass] => 0
)
)
search_cron_limit: "100"
search_default_module: "node"
Comments
Comment #1
alan d. commentedDoes the admin user actually have any roles? Since I could not use user_access('permission') with admin user 1 (they always have permission), I moved to a manual role check.
Comment #2
aaronbaumanuser 1 has "administrator" role with the following permissions:
* use search
* use advanced search
* administer search
additionally, "authenticated user" has the permission "use search"
When i toggle the checkbox for "Only show one form at a time" to off, the basic search form shows up, but the advanced form is still empty.
I think it's because i have opted to hide all the advanced search options:
(edit: see attached image. drupal doesn't like my img tag for some reason)
Would it make more sense to get rid of the "admin bypass" checkbox, and expose that as a permission instead?
Comment #3
alan d. commentedOK to paraphrase, the issue is that you only want to show the basic form with the search restrictions? Or are you trying to allow the admin user 1 to access this?
Comment #4
aaronbaumanRight - basically my goal is to show the simplest of search forms: one text input field and one submit button and nothing else.
(Think Google 10 years ago)
Comment #5
alan d. commentedSeems strange, but this is a feature request as well user 1 bypasses all permissions by design and that control was never build in..
Anyways, easy fix is to force the form to disappear for all users unconditionally. Easy to implement and understand without having to know the inner workings of Drupal permission system. :)
Untested patch attached.
Comment #6
alan d. commentedA picture says a thousand words:
Comment #7
aaronbaumanOK, seems like a good approach.
Your patch referred to a non-existent variable though.
Here's a reroll that grabs the appropriate setting.
Comment #8
alan d. commentedPushed (a few years latter...)
Cheers
Alan