Hi,

I'm trying to use apache solr and search404 but each time I enter a wrong url ike /blabla, I've got this message :

The Apache Solr search engine is not available. Please contact your site administrator.
The page you requested does not exist. For your convenience, a search was performed using the query blabla.
Notice: Undefined index: module in apachesolr_search_form_search_form_alter() (line 980 of D:\Documents\www\drupal-7.x\sites\all\modules\apachesolr\apachesolr_search.module).

Solr works nice otherwise.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milesw’s picture

I'm getting the Notice as well, but not the error. Which version are of the Apache Solr module are you using? The dev version has some minor changes that break this module.

abrebion’s picture

I'm using 7.x-1.0-beta11

milesw’s picture

Sorry, never got a notification that you replied.

Here's a patch with the changes I'm using to get Search404 working with the dev version of apachesolr.module. Not sure if beta11 is the same, but looks like they just cut beta12 a couple days ago and I'm guessing the patch will work with beta12.

Note this patch will probably break Search404 compatibility with search modules other than Apache Solr.

paulmckibben’s picture

Status: Active » Needs review
FileSize
2.26 KB

@milesw, thanks for your patch. It helped me start!

Here is a modified patch that should *not* break compatibility with other search modules.

An additional note: even with this patch, you will still get the "The Apache Solr search engine is not available" error, even though search results are still returned. You can turn off this error message by going to admin/config/search/apachesolr/settings, expand "Advanced Configuration," and set "On failure" to "Show no results." I think this is a bug in the apachesolr project, and I will file an issue there and add a comment here to point to that issue for reference.

paulmckibben’s picture

drasgardian’s picture

I was receiving these very similar errors about undefined index: module

Notice: Undefined index: module in apachesolr_search_form_search_form_alter() (line 722 of [path]/modules/apachesolr/apachesolr_search.module).
Notice: Undefined index: module in i18n_node_form_search_form_alter() (line 394 of [path]/modules/i18n/i18n_node/i18n_node.module).

which I fixed with the attached patch

zyxware’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

@milesw, @paulmckibben - Thanks for the patches. I have applied the patch in the 7.x-1.x branch.

@drasgardian - Thanks for the patch. I am not sure if we can take out the parameters from the drupal_get_form call.

Please revert if there are issues.

Status: Fixed » Closed (fixed)

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