Hi there, thanks for the module first off. I think this is a great idea. I am currently running into an issue on the search results page.
Anytime the search 404 module is invoked (when a page that doesnt exist is viewed) I receive the following warning at the top of the page:
"Strict warning: Only variables should be passed by reference in search404_page() (line 181 of home/cps/www/sites/all/modules/search404/search404.module)."
The search works fine though as the expected results are returned and the search form is correctly rendered:
The line in question is:
$output = drupal_render(drupal_get_form('search_form', NULL, empty($keys) ? '' : $keys, 'node')) . drupal_render($results);
My first thought was to put the drupal_render($results) on its own line and concatenate it to the $output variable:
$output = drupal_render(drupal_get_form('search_form', NULL, empty($keys) ? '' : $keys, 'node')));
$output.= drupal_render($results);
This simply confirmed that the issue lies in the rendering of the search form and not the rendering of the results.
This actually breaks down I believe, to the form_state argument required by the search_form function (http://api.drupal.org/api/drupal/modules--search--search.module/function...). Currently the call is simply passing null, which is why the Strict Warning is occurring.
Not really sure what we should pass instead, this form doesnt really need a state as far as I can tell.
Comments
Comment #1
yukare CreditAttribution: yukare commentedWhy the need to test $keys if it is empty? Can not just pass it, as if empty we send a '' and not other value.
Comment #2
zyxware CreditAttribution: zyxware commented@skadu - Thanks for the bug report. The issue was that drupal_render requires parameter by reference and hence would only take actual variables. I have fixed this and have committed to the latest 7.x-1.x-dev.
@yukare - Yes, you are right. I have made the changes and have committed this as well.