Hi,

By default, the site search box sends its POST to the URL of the current page. That doesn't work on Custom Error pages as they immediately return the set HTML. This patch uses a form_alter hook to post to search/node, allowing the form to work as expected.

I haven't had a chance to test on D6, but I imagine it's a problem there as well.

--Andrew

CommentFileSizeAuthor
correct_search_post.patch782 bytesdeviantintegral

Comments

kbahey’s picture

Status: Needs review » Fixed

Thanks.

Applied to 5.x and 6.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Anonymous’s picture

Search form does not appear to work on 403 / 404 CustomError module pages using Drupal 6.5 and customerror-6.x-1.0. When try to search it simply returns the same 403 or 404 page (patch appears to be in place but not working).

deviantintegral’s picture

While I doubt it's the issue, you really should upgrade to Drupal 6.9 to ensure that you have the latest security patches.

What is the form tag set to for the search form?

deviantintegral’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)
jhodgdon’s picture

Project: Customerror » Drupal core
Version: 5.x-1.x-dev » 6.9
Component: Code » search.module

You can try this on the drupal.org site. It is broken in 6.9.

a) Visit a non-existent page, like drupal.org/project/abcdefg

b) Try to search for something, by typing a term into the search box and clicking submit. You end up staying on the 404 page.

The reason is that the search block on the page has its action set to the current URL. If the current URL is a 404 page, search doesn't work.

It's a real problem, because when a user gets to a 404 page is specifically when they are very likely to want to search.

deviantintegral’s picture

Version: 6.9 » 6.10

This is still a problem in Drupal 6.10 as well.

wretched sinner - saved by grace’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Duplicate of #292565: Regression: Can't set /user to 403 page (was: login destination is broken).

Help us test the patch, and it will be backported to 6.x also.