When a file is not found on the server (error 404), you will get a notice in the status report (D7.4 + PHP 5.3.3)
Line 722 of apachesolr_search.module:

<?php
function apachesolr_search_form_search_form_alter(&$form, $form_state) {
  if ($form['module']['#value'] == 'apachesolr_search') {
    // ....
  }
}
?>

Needs to be:

<?php
function apachesolr_search_form_search_form_alter(&$form, $form_state) {
  if (!empty($form['module']['#value']) && $form['module']['#value'] == 'apachesolr_search') {
    // ....
  }
}
?>

(check for empty)

Comments

egarias’s picture

Version: 7.x-1.0-beta8 » 7.x-1.0-beta9

Not corrected in Beta9.
Now the line is 841,

We also have this one:
apachesolr_search_search_type en apachesolr_search_menu_alter() line 148 apachesolr_search.module

egarias’s picture

Status: Closed (fixed) » Active

I think it must be active,
The apachesolr_search_search_type en apachesolr_search_menu_alter() line 148 apachesolr_search.module, i think has impact on search page configuration "Core search= when trying to add some custom filter wich then is never saved.

We also have:

Notice: Undefined index: apachesolr_search_per_page en apachesolr_search_user_defined_search_page() (línea 48 de /home/empresar/public_html/sites/all/modules/apachesolr/apachesolr_search.pages.inc).

AND
Warning: Division by zero en pager_default_initialize() (línea 281 de /home/empresar/public_html/includes/pager.inc).

elianm’s picture

I'm getting this one too:

Notice: Undefined index: apachesolr_search_search_type në apachesolr_search_menu_alter() (rreshti 148 i /home/peshku/httpdocs/sites/all/modules/apachesolr/apachesolr_search.module).

Another one while executing cron is:

Notice: Undefined index: indexing_callback në apachesolr_node_to_document() (rreshti 95 i /home/peshku/httpdocs/sites/all/modules/apachesolr/apachesolr.index.inc).

nick_vh’s picture

StatusFileSize
new1.68 KB

Does this fix it?

nick_vh’s picture

Status: Active » Needs review
egarias’s picture

patch applied, no success,
the messages are:
on page: http://empresarios.peoplenews.me/?f[0]=im_5_field_provincia%3A33

Notice: Undefined index: apachesolr_search_search_type en apachesolr_search_user_defined_search_page() (línea 14 de /home/empresar/public_html/sites/all/modules/apachesolr/apachesolr_search.pages.inc).
Notice: Undefined index: apachesolr_search_per_page en apachesolr_search_user_defined_search_page() (línea 48 de /home/empresar/public_html/sites/all/modules/apachesolr/apachesolr_search.pages.inc).
Warning: Division by zero en pager_default_initialize() (línea 281 de /home/empresar/public_html/includes/pager.inc).

I think this has a big penalty on CPU as today my server is overloaded

Thanks

nick_vh’s picture

Could you please provide us with a patch? I'm not getting those notices so you did something it seems to invoke them. Or write down steps to reproduce them?

egarias’s picture

The site: http://boletin.artic-group.net has 4 pages:
Core search (bundle:boletin OR licitaciones)
Boletin (bundle:boletin)
Licitaciones (bundle:licitaciones)
taxonomy (bundle:boletin OR licitaciones)

The pages never keep the custom search checkbox marked.
but some seem to work and others no (licitaciones and taxonomy show good results and the pager, but boletin and core search don't)

This behaviour is happening on 3 different sites including the boletin.artic-group.net.

Tell me what to do if I can help.

nick_vh’s picture

StatusFileSize
new3.97 KB

Hmm, I think I know what happened. We reverted some functionality with regards to drupal core and search pages in the end and probably it wasn't validated completely.
Another try, I guess this one should work.

Also I can see a weird issue in your description. It seems that you have a search page as your frontpage. I'm not sure how it currently handles that so I wouldn't recommend that practice yet.

nick_vh’s picture

Priority: Minor » Major
egarias’s picture

perfect!!! many thanks this is fast and efficient!

Regarding your recomendation about front page, I see no visible errors, so maybe I can keep my front page as a search one, considering my content it is very convenient if no collateral effects.

Thanks

nick_vh’s picture

Status: Needs review » Fixed

Did some code cleanup in the patch and committed. Thanks for the co-operation!

Status: Fixed » Closed (fixed)

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

marcvangend’s picture

If it helps anyone: I also ran into "Notice: Undefined index: apachesolr_search_per_page" today, using the beta11 release. The notice disappeared after re-saving the search page settings at /admin/config/search/apachesolr/search-pages/[search-page]/edit (where [search-page] is the machine name of your search page).

nick_vh’s picture

Could you also tell us the exact error, eg.: where it came from? Line and file?

marcvangend’s picture

Nick, the error was:

Notice: Undefined index: apachesolr_search_search_type in apachesolr_search_user_defined_search_page() (regel 18 van /var/spool/www/user/acc/public_html/sites/all/modules/apachesolr/apachesolr_search.pages.inc). 
Notice: Undefined index: apachesolr_search_per_page in apachesolr_search_user_defined_search_page() (regel 52 van /var/spool/www/user/acc/public_html/sites/all/modules/apachesolr/apachesolr_search.pages.inc).
raulmuroc’s picture

Status: Closed (fixed) » Active

As said before ,everywhere is found the following:

function apachesolr_search_form_search_form_alter(&$form, $form_state) {
  if ($form['module']['#value'] == 'apachesolr_search') {
    // ....
  }
}

Needs to be:

function apachesolr_search_form_search_form_alter(&$form, $form_state) {
  if (!empty($form['module']['#value']) && $form['module']['#value'] == 'apachesolr_search') {
    // ....
  }
}

They're different lines with this problem. This is not fixed cuz I downloaded the latest version of Apache solr Integration and problem persists.

nick_vh’s picture

StatusFileSize
new734 bytes

Can you please be a bit more descriptive when you mention there are different lines with this problem?
attached is the patch but you could have easily done the same.

nick_vh’s picture

Status: Active » Fixed

Committed this small patch. Please open a new issue next time

nick_vh’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev

Status: Fixed » Closed (fixed)

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