Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
user system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
15 Jan 2008 at 11:58 UTC
Updated:
30 Jan 2008 at 23:04 UTC
Jump to comment: Most recent file
There is a typo error in user search form that renders the same content without doing the search.
Patch provided.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | search_c.patch | 1.68 KB | theborg |
| #17 | search_b.patch | 2.36 KB | theborg |
| #13 | search.patch | 1.14 KB | chx |
| #9 | user_search_c.patch | 859 bytes | theborg |
| #4 | user_search_b.patch | 819 bytes | theborg |
Comments
Comment #1
catchtrivial patch, tested, works, RTBC.
Comment #2
theborg commentedRelated to this form also: http://drupal.org/node/208790
Comment #3
gábor hojtsyHm, we use NULL not null. Also what does search_data() do there? There is not even a parameter at that position AFAIS:
in the patch:
drupal_get_form('search_form', url('admin/user/search'), $keys, 'user', null, search_data($keys, 'user'));
function signature:
function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
Comment #4
theborg commentedCorrected NULL typo.
As per form_api:
drupal_get_form can take optional additional arguments, which will be simply passed on to the $form builder function.
Comment #5
gábor hojtsyYes, that doc refers to the arguments of the form builder I quoted above. How does search_data($keys, 'user') get there.
Comment #6
chx commentedWhat Gabor says is that you are passing NULL for $prompt and then something else which has no matching parameter in the function signature.
Comment #7
theborg commentedYes, I'm aware of that, sorry, I missunderstood documentation.
The keys end as a callback parameter to drupal_retrieve_form and search_form function
Sure there is a correct way of solving this bug.
Comment #8
chx commentedSIGH! You are passing five (5) arguments to search_form which takes four (4) arguments aside from the form_state that's automatically added. The fifth argument is not going to be used. Got it?
Comment #9
theborg commentedOk, got it, sorry for that mess.
This patch sets the action to null, so it will go to 'search/user'.
Comment #10
dvessel commentedOnly affects the admin end.
The patch works but I don't think you need to check for keys. search_data will handle it just fine but I'm not sure if the returning nothing and appending to the string would cause a notice.
Comment #11
chx commentedIf you pass in NULL then the action
wil be
search/user. This is not what you want. I agree with dvessel that passing in a NULL forsearch_datawill work the function returns NULL very fast which PHP nicely casts to the empty string.Comment #12
chx commentedWhy in the first place do we have this page? What does it do that search/user does not?
Comment #13
chx commentedcatch said we nuked admin/content/search for it did nothing that search/node did not. Same for this page. Fixing the search form does not hurt, however.
Comment #14
catchNothing.
fwiw, admin/content/search was removed a couple of months ago for similar reasons.
Comment #15
chx commentedI guess catch crossposted my patch.
Comment #16
dvessel commentedWorks just fine. The menu link still exists though. Thought it was cached in the menu system.. got it cleared and it's still there.
Comment #17
theborg commentedTested and works ok.
Removed the search link from the admin users menu.
Comment #18
theborg commentedEdit:
$form['#redirect'] = FALSE;causes /search path to not work.Comment #19
theborg commentedComment #20
chx commentedOK.
Comment #21
gábor hojtsyHm, all right. The argument sounds right that we removed the content search on the same grounds. Well, committed.
Comment #22
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.