This is a very useful module! I've had a few cases where we want to use the Search 404 functionality, but also need to include other content on the 404 page. Most recently this also included having the search results in the middle of some other content. To achieve this, I created a block for the Search 404 module that provides the search results.

To keep the block the same as the search results page, I refactored two small parts of the existing module:

  1. Part of search404_page() was extracted into a new function search404_results() that is now used by the page and the block.
  2. Another part of search404_page() was extracted into another function, search404_get_default_search(), for use in the page and the block.

I hope this will make a useful addition to this module. Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anish_zyxware’s picture

Assigned: Unassigned » anish_zyxware
Issue summary: View changes
Status: Active » Needs work

This has to be updated according to newest code.

glen.pinheiro’s picture

glen.pinheiro’s picture

Status: Needs work » Needs review
FileSize
4.48 KB

The patch file has now updated to the latest code.

anish.a’s picture

Status: Needs review » Needs work

The code for set message is called in 3 places. It can be using the latest message function, search404_error_message()
drupal_set_message(t('The page you requested does not exist. For your convenience, a search was performed using the query %keys.', array('%keys' => check_plain($keys))), 'error');

glen.pinheiro’s picture

Status: Needs work » Needs review
FileSize
4.07 KB

Updated the set message calls with 'search404_error_message()' function.

glen.pinheiro’s picture

FileSize
4.69 KB
glen.pinheiro’s picture

FileSize
5.21 KB

Updated the patch with latest code.

anish_zyxware’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed. Finally, it works fine.

anish_zyxware’s picture

Status: Reviewed & tested by the community » Closed (fixed)