Download & Extend

"Unsupported operands" thrown in drupal_get_breadcrumb when search404's page is rendered

Project:Search 404
Version:6.x-1.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

Search404 plain doesn't work for us, and I'm not sure why.

In between search404_page() returning, and the page.tpl.php rendering, I get the error:

Fatal error: Unsupported operand types in /var/www/drupal-6/includes/common.inc on line 1445

Poking around in menu.inc, this seems to be because drupal_get_breadcrumb() calls menu_get_active_trail() and from that menu_get_item(), which is working off the missing page path, not /search404. Because the missing page doesn't exist in the menu_router table (obviously) then this returns a FALSE. When that bubbles up as far as the breadcrumb generation, then l() gets a third parameter that isn't an array, and the error above is thrown.

Shouldn't search404 handle the fact that the non-existent page won't be in menu_router? There's some code saying "EVIL HAXX" (!) that seems to be doing some sort of $_GET['q'] swapping, but I assume it can't be working properly.

Here's our setup:

Search404 6.1-1.1
Drupal 6.6
PHP 5.2.6

Comments

#1

Assigned to:Anonymous» zyxware

Does this error show up in all the 404 searches or some specific instance?

Could you also post the URL that causes this error?

Thanks
Zyxware

#2

Status:active» postponed (maintainer needs more info)

#3

All 404ed URLs cause this error.

As I say, it happens after the MENU_CALLBACK in the module; so when I then navigate to a page that does exist I see e.g:

* For your convenience, a search was performed using the query foo.
* For your convenience, a search was performed using the query foo bar.
* For your convenience, a search was performed using the query foo bar baz.

#4

Assigned to:zyxware» jp.stacey
Status:postponed (maintainer needs more info)» closed (won't fix)

@zyxware: looks like this was a combinatorial bug, caused by a stub module. It was only running a few drupal_set_html_head()s in its _init() hook, but there might have been some knock-on effect. But we'll look into it at our end, so I think this bug can be closed. Sorry if I wasted your time!

#5

No issues jp.stacey, glad you found the root cause of the issue.

We are closing the bug from our side.

Regards
Zyxware

#6

Status:closed (won't fix)» closed (fixed)

#7

Version:6.x-1.1» 6.x-1.x-dev
Status:closed (fixed)» active

Getting the same problem now:

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

Also caused by menu_get_active_trail(), eventually a l(, , ) function is called without any arguments resulting in above error. Where to look for an answer to this problem? Why does l(, , ) eventually end up like that?

If its a conflicting module like said above, then how to find out which one?

#8

Status:active» closed (fixed)

Just found out it's being caused by ApacheSolr, so they need to fix it.

#9

I am also receiving this error in conjunction with using solr. any info on how to resolve this would be greatly appreciated.

#10

Project:Search 404» Apache Solr Search Integration
Version:6.x-1.x-dev» 6.x-1.0-rc5
Status:closed (fixed)» active

Yeah, we're running into this issue with the ApacheSolr integration too. Works fine with standard Drupal search. Anyone know what in ApacheSolr is causing the problem?

Edit: Looks like it is a breadcrumb issue with Solr too. apachesolr_search.module calls drupal_set_breadcrumb(), calling menu_get_active_breadcrumb(), but menu_get_active_breadcrumb will return erroneous results when called from the 404 page.

Best solution right now is to check if we're loading a 404 page, and if so, don't call the menu_get_active_breadcrumb.

#11

Status:active» closed (duplicate)

Dup: #550534: Search 404 incompatibility

#12

Status:closed (duplicate)» active

I am getting the same issue, but without Apache Solr.

Disabling search404 solved it for me, but as I understand there is some conflicting module ... How to find it?

#13

Project:Apache Solr Search Integration» Search 404
Version:6.x-1.0-rc5» 6.x-1.9
Assigned to:jp.stacey» Anonymous

#14

Status:active» closed (duplicate)

Ah, it is Page Title as explained here #550534: Search 404 incompatibility

nobody click here