When Jump directly to the search result when there is only one result or Jump directly to the first search result even when there are multiple results is enabled and fires, I get white screen, with following messages being displayed an a next loaded page:
Warning: strpos() expects parameter 1 to be string, array given in url_is_external() (line 2311 of /path/to/site/includes/common.inc).
Warning: substr() expects parameter 1 to be string, array given in url_is_external() (line 2315 of /path/to/site/includes/common.inc).
Warning: strpos() expects parameter 1 to be string, array given in drupal_strip_dangerous_protocols() (line 1350 of /path/to/site/includes/common.inc).
Warning: strpos() expects parameter 1 to be string, array given in url() (line 2196 of /path/to/site/includes/common.inc).
Warning: substr() expects parameter 1 to be string, array given in url() (line 2197 of /path/to/site/includes/common.inc).
Warning: strpos() expects parameter 1 to be string, array given in drupal_strip_dangerous_protocols() (line 1350 of /path/to/site/includes/common.inc).
Warning: strpos() expects parameter 1 to be string, array given in url() (line 2212 of /path/to/site/includes/common.inc).
Warning: explode() expects parameter 2 to be string, array given in url() (line 2213 of /path/to/site/includes/common.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | search404-wsod_jump-2275673-7.patch | 684 bytes | anish_zyxware |
| #1 | search404-wsod_on_jump-2275673-1.patch | 701 bytes | alex.bukach |
Comments
Comment #1
alex.bukach commentedThe bug was caused by the fact that when jumping to a node, the module tried to redirect to
$node->path, while$node->pathis an array. The patch has fallback for the case if$node->pathis string.Comment #2
hwasem commentedThis patch saved me! We just upgraded our site and are using Search404. Each time someone links from an old URL and it found only one match, they were redirected with a whole bunch of these errors in OP. With patch, it is just the little note with "The page you requested does not exist. A search for XXXXXX resulted in this page." Yay! It works great.
Comment #3
alan d. commentedIt is simple as this I believe:
i.e. ditch the "if (isset($results['#results'][0]['node']->path)) {" conditional altogether
This still throws a WSOD (server dependent) in some cases, like if path auto installed but the node doesn't have an alias.
$node->path === array(pathauto => 0)
Comment #4
gunzip commentedwill this be committed to stable version ? it's somewhat critical...
Comment #5
anish.a commentedComment #6
anish_zyxware commentedComment #7
anish_zyxware commentedPatch that uses method mentioned in #3
drupal_get_path_alias() returns unaliased path if aliased path is not there.
Comment #9
anish_zyxware commented