Search404.module integrates with ApacheSolr. On performing a page not found search, this happens (showing debug backtrace):

#0  l(, , ) called at [/var/www/vhosts/cmsmatch.com/httpdocs/includes/menu.inc:1591]
#1  menu_get_active_breadcrumb() called at [/var/www/vhosts/cmsmatch.com/httpdocs/sites/all/modules/apachesolr/apachesolr_search.module:234]
#2  apachesolr_search_execute(drupal software, , , search/, 0) called at [/var/www/vhosts/cmsmatch.com/httpdocs/sites/all/modules/apachesolr/apachesolr_search.module:129]
#3  apachesolr_search_search(search, drupal software)
#4  call_user_func_array(apachesolr_search_search, Array ([2] => search,[3] => drupal software)) called at [/var/www/vhosts/cmsmatch.com/httpdocs/includes/module.inc:450]
#5  module_invoke(apachesolr_search, search, search, drupal software) called at [/var/www/vhosts/cmsmatch.com/httpdocs/sites/all/modules/search404/search404.module:119]
#6  search404_page()
#7  call_user_func_array(search404_page, Array ()) called at [/var/www/vhosts/cmsmatch.com/httpdocs/includes/menu.inc:348]
#8  menu_execute_active_handler(search404) called at [/var/www/vhosts/cmsmatch.com/httpdocs/includes/common.inc:360]
#9  drupal_not_found() called at [/var/www/vhosts/cmsmatch.com/httpdocs/index.php:24]

Function l(, , ) is called by ApacheSolr -- Drupal crashes the page.

Comments

Anonymous’s picture

I can now confirm, this is being caused by the Apache Solr search module. Disabling just that module fixes search404.module. So the problem is really somewhere at apachesolr_search.module... Where to look?

The related error output to screen is

Fatal error: Unsupported operand types in /var/www/vhosts/domain.com/httpdocs/includes/common.inc on line 1552 (white screen, drupal crashed)

pwolanin’s picture

Looks like an invalid call to l() - so maybe the Solr breadcrumb?

Anonymous’s picture

Seems to be, commenting out line 241 in apoachesolr_search.module prevents the problem.
drupal_set_breadcrumb(array_merge(menu_get_active_breadcrumb(), $query->get_breadcrumb()));

The problem is:
menu_get_active_breadcrumb() somehow cant find the menu_get_active_trail(), this happens in menu.inc

drewish’s picture

I think that #551582: Show value instead of key in CCK facets is to blame for this. There's some bugs in the breadcrumb theme functions that cause empty entries to be added to the end.

robertdouglass’s picture

@drewish, @morningtime - please confirm the 404 fix now that #551582 has been committed, and mark this fixed if possible.

drewish’s picture

Status: Active » Fixed

I'm not seeing this issue any more @morningtime if you are please re-open the issue with more detail of how to replicate it.

harking’s picture

This is still an issue in 6.x-1.x until #551582: Show value instead of key in CCK facets is back ported to the 1.x tag

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Status: Closed (fixed) » Active

It's still an issue in 2.x. Today's latest Solr dev + latest 1.9 Search404 module still give this problem. Although Search404's project homepage explicitly mentions it can be integrated with SOLR - somehow, it just doesn't. Has nobody found a solution?

It cant possible be due to issue #551582: Show value instead of key in CCK facets, because that is supposedly fixed already in the 2.x series.

@harking, to replicate:

On drupal 6.16:
1. install apachesolr_search latest 2.x dev
2. install search404 v1.9
3. visit a non-existing url

The result is a white screen with:

Fatal error: Unsupported operand types in /var/www/vhosts/domain.com/httpdocs/includes/common.inc on line ~1552
cfennell’s picture

Hmm, I did a fresh D6 install along with the the module versions mentioned in #9, visited a non-exstent URL and could not reproduce the error. Is it possible the problem was fixed between the 19th and now?

jpmckinney’s picture

Priority: Critical » Normal

I, too, cannot reproduce this bug.

jpmckinney’s picture

Status: Active » Postponed (maintainer needs more info)
dpalmer’s picture

I am experiencing this problem too after transferring one of my sites to a new macbook pro. I'm using the exact same code and database that was on my old laptop in which the solr search works fine, but I cannot get it to work on my new laptop. The same code & database are also on one of my live servers and it's working fine. Any idea on how I can resolve this issue?

dpalmer’s picture

^^ I noticed my MAMP was running PHP 5.3.x, switching it to PHP 5.2.x fixed everything. Hopefully this information will help someone else out!

jpmckinney’s picture

Title: menu_get_active_breadcrumb messed up after search404 » PHP 5.3 compatibility
Status: Postponed (maintainer needs more info) » Active

Changing title.

pwolanin’s picture

Any insight into the more specific point of 5.3 incompatibility?

jpmckinney’s picture

#9 has steps to reproduce.

pwolanin’s picture

Can you please check what function is line 1552? In the latest core that line # is inside a code comment before the l() function.

I've seen this sort of error before for l() when a NULL or string is passed in as the options, due to this:


function l($text, $path, $options = array()) {
  global $language;

  // Merge in defaults.
  $options += array(
      'attributes' => array(),
      'html' => FALSE,
    );

Why is apachesolr calling l() with empty arguments? If it only happens in combination, I might blame Search404

jpmckinney’s picture

Title: PHP 5.3 compatibility » Search 404 incompatibility
Category: bug » support
Status: Active » Postponed (maintainer needs more info)
Anonymous’s picture

@pwolanin:

It's because menu_get_active_breadcrumb() returns an empty value:

Array
(
    [0] => Array
        (
            [title] => Home
            [href] => <front>
            [localized_options] => Array
                (
                )

            [type] => 0
        )

    [1] => 
)

That [1]=> (second array item) should be an array, if not then it crashes the l() function in common.inc.

The problem might be that Search404 does not pass a page-title + url. Menu breadcrumb should return something like this:

Array
(
    [0] => Array
        (
            [title] => Home
            [href] => <front>
            [localized_options] => Array
                (
                )

            [type] => 0
        )

    [1] => Array
        (
            [title] => Search404
            [href] => /search/node/query
            [localized_options] => Array
                (
                )

            [type] => 0
        )
)
Anonymous’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

This issue was caused by the Page Title module!!

That module overrides breadcrumbing/page titles, leading to crashes.

giorgio79’s picture

Status: Closed (won't fix) » Active
pwolanin’s picture

Status: Active » Closed (won't fix)

unsupported branch