Hi There,

there seems to be an instability with Display Suite and the Search404 module.
Instead of displaying Search404's search results page in place of a standard 404 page, the search results break with the following error and the search form isn't even displayed.

Notice: Undefined index: module in ds_search_form_search_form_alter() (line 505 of G:\wamp\www\nursery\sites\all\modules\ds\modules\ds_search\ds_search.module).

Combined, both of these modules provide a great way to manage search results display and 404 errors. It would be great if they could work together.

This was touched at Search404 with issue #1253426: Patch: Search 404 should use default search engine, it may help shed some light on where the issue actually lies...

Comments

Anonymous’s picture

Version: 7.x-1.4 » 7.x-1.5
Category: feature » bug

Issue is still valid for 7.x-1.5. And I assume it's a bug to access non-existent array keys.

I added an array_key_exists('module', $form). It removed the notice of course.

Search404 still doesn't display the search form. I can't tell, if this is due to DS or a bug in Search404. Someone with better understanding of the Form and Search API should have a brief look at it. Just to assess, if theres is a need for action or how to deal with it for now.

Anonymous’s picture

This is the $form array passed into ds_search_form_search_form_alter():

Array
(
    [#form_id] => search_form
    [#type] => form
    [#build_id] => form-5XSrPUp19LOMs9gPFSz--HpUZbKEgjIYsULmThXCrLg
    [form_build_id] => Array
        (
            [#type] => hidden
            [#value] => form-5XSrPUp19LOMs9gPFSz--HpUZbKEgjIYsULmThXCrLg
            [#id] => form-5XSrPUp19LOMs9gPFSz--HpUZbKEgjIYsULmThXCrLg
            [#name] => form_build_id
        )

    [#token] => search_form
    [form_token] => Array
        (
            [#id] => edit-search-form-form-token
            [#type] => token
            [#default_value] => 48euplWfGbYrzaOvmKEUo9ZaQqRgHEd0z0J_-ndzZ8Y
        )

    [form_id] => Array
        (
            [#type] => hidden
            [#value] => search_form
            [#id] => edit-search-form
        )

    [#id] => search-form
    [#method] => post
    [#action] => /testtesttesttest
    [#theme_wrappers] => Array
        (
            [0] => form
        )

    [#tree] => 
    [#parents] => Array
        (
        )

    [#validate] => Array
        (
        )

    [#submit] => Array
        (
        )

    [#theme] => Array
        (
            [0] => search_form
        )

)
swentel’s picture

Category: bug » feature

It's not because there's a conflict with a module that this is automatically a bug report :)

Anonymous’s picture

So the input for form_alter is corrupted by Search404? For me it looked like DS doesn't deal properly with (valid) arguments passed to a core hook.

joelpittet’s picture

Latest search404 7.x-1.x dev branch fixed this for me.

swentel’s picture

Status: Active » Closed (works as designed)

Closing as per #5

swentel’s picture

Issue summary: View changes

Corrected spelling mistakes..!