Change record status: 
Project: 
Introduced in branch: 
7.x
Description: 

The return structure of hook_node_search_result() has been revised.

Previously, hook_node_search_result() returned an indexed array, now it returns an associative array.

For themers, this change mostly means you can now use $info_split['comment'] in search-result.tpl.php, that information was previously part of the $result['extra'] array.

Example hook implementation from comment.module:

<?php
/**
 * Implements hook_node_search_result().
 *
 * Formats a comment count string and returns it, for display with search
 * results.
 */
function MYMODULE_node_search_result($node) {
 
// Do not make a string if comments are hidden.
 
if (user_access('access comments') && $node->comment != COMMENT_NODE_HIDDEN) {
   
$comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
   
// Do not make a string if comments are closed and there are currently
    // zero comments.
   
if ($node->comment != COMMENT_NODE_CLOSED || $comments > 0) {
      return array(
'comment' => format_plural($comments, '1 comment', '@count comments'));
    }
  }
}
?>
Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done