In some cases, I get my log flooded with this message:

Notice: Undefined index: #type in template_preprocess_search_theme_form() (line 1109 of [path-to-drupal]/modules/search/search.module).

Solution should be pretty straightforward, just to check whether the index is present or not.

CommentFileSizeAuthor
#1 drupal-search-missing-index-1987904-1.patch792 bytesm1n0

Comments

m1n0’s picture

StatusFileSize
new792 bytes

Here is a simple fix.

It might be that some other module is breaking this but a bit more robustness of the code cannot harm anyone right?

m1n0’s picture

Status: Active » Needs review
rooby’s picture

I'm pretty confident this is not a drupal core bug.

I think it is another module messing up the form array, which then breaks the search module.

Are you using the search_config module by any chance?

If so, try the patch at #1024770: Prevent php notice (it has been committed but is only in the dev version, not the release).

If not, what other search modules are you using and are there any other search related errors in your logs?

lelizondo’s picture

Status: Needs review » Active

I'm getting this error too and I do have installed the search_config module. Apache Solr is also present but it's not trowing any logs. The patch mentioned in #1024770: Prevent php notice doesn't solve the problem.

If I disable the search_config module I still have this log.

The patch above does solve this problem.

lelizondo’s picture

Status: Active » Needs review
rooby’s picture

This really shouldn't be able to happen with a clean drupal install, so I still think it is the issue of another module.

I have also seen this error occur because of bugs in other search related contrib modules.

Do you have any other modules or custom code that modify the search form?

If so, try disabling them all one at a time and see which one is the cause (if it is one of them).

jhodgdon’s picture

Status: Needs review » Closed (cannot reproduce)

This is definitely not a Drupal Core problem. It looks like some other module on your site is misusing the search form. Drupal Core does not have this problem by itself.

jhodgdon’s picture

Issue summary: View changes

Removing specific path