Closed (fixed)
Project:
Drupal core
Version:
4.7.3
Component:
search.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2006 at 22:32 UTC
Updated:
11 Sep 2006 at 11:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
craines commentedWe found this same problem when arriving at an error 403. I'm not sure as to the exact cause, but it appears to stem from the fact that the action parameter of the search block form defaults to the same url as the current page.
When you submit, the search module seems to intercept it and redirect you to the search results -- but this doesn't happen on a 404, 403, or on pages such as project/issues (my guess is that the project module intercepts it first -- you can try it out by using the search block at drupal.org/project/issues).
We fixed it by setting the $form['#action'] to 'search/node' (search.module drupal v4.7.2, lines 1041 & 1042 below). This seems to work fine on our site but not sure of the full ramifications of this change...
Comment #2
RobRoy commentedI think this is at least a 'normal' issue. Could we somehow check if we are on a 404/403 page and then change the action to search/node? Or, are there any issues with always having the action set to this?
Comment #3
rickvug commentedSee the Search 404 module: http://drupal.org/node/26010 . This might be what you are looking for.
Comment #4
RobRoy commentedThat looks like a nice module, but not the issue. When going to http://drupal.org/foobar and then trying a search from the search box, say for "Drupal". You don't get a list of search results as the action of that form is going to a non-existing page.
Comment #5
pwolanin commentedI'm seeing the same behavior on the 403 or 404 page- very non-intuitive.
The fix in #1 seems to work for me, and I don't see why it should cause any problems, given the submit function:
Attached as a patch against 4-7-CVS version of search.module.
Comment #6
beginner commentedIt's simple enough and it works (tested on cvs/head).
(I'm just a little confused at the way you create 4.7-cvs patches :) I had to manually enter the name of the file to patch -- maybe it's intended this way.)
Comment #7
pwolanin commentedSome of these patches are made just against a copy of the original file using "diff" on the command line (Mac OSX). They work fine for me with "patch -p0 < patchfile" on the command line. Most of my more recent patches have been made with "cvs diff" (now that I've sort of got the hang of cvs), and that produces a slightly different header- perhaps that's the difference.
Comment #8
drummCommitted to HEAD with a modified comment.
Comment #9
pwolanin commentedcommited to 4.7 branch?
Comment #10
drummNo need to ask... killes will get to it.
Comment #11
killes@www.drop.org commentedbackported
Comment #12
(not verified) commentedComment #13
Scott commentedThe current download of 4.7.3 does not include the patch for this bug in search.module
Comment #14
pwolanin commentedyou are correct- the reason is that released versions are fixed. You can get the latest patched version of 4.7 at: http://drupal.org/drupal-4.7-cvs, otherwise this patch will be included when there is a 4.7.4 release.
Comment #15
(not verified) commented