Skip to content
Snippets Groups Projects
Commit fe0a55d2 authored by Steven Wittens's avatar Steven Wittens
Browse files

- #26458: node_search doesn't node_view, causing bad snippets.

parent 75a7a641
No related branches found
No related tags found
No related merge requests found
......@@ -568,6 +568,17 @@ function node_search($op = 'search', $keys = null) {
$results = array();
foreach ($find as $item) {
$node = node_load(array('nid' => $item));
// Get node output (filtered and with module-specific fields).
if (node_hook($node, 'view')) {
node_invoke($node, 'view', false, false);
}
else {
$node = node_prepare($node, false);
}
// Allow modules to change $node->body before viewing.
node_invoke_nodeapi($node, 'view', false, false);
$extra = node_invoke_nodeapi($node, 'search result');
$results[] = array('link' => url('node/'. $item),
'type' => node_invoke($node, 'node_name'),
......@@ -575,7 +586,7 @@ function node_search($op = 'search', $keys = null) {
'user' => format_name($node),
'date' => $node->changed,
'extra' => $extra,
'snippet' => search_excerpt($keys, check_output($node->body, $node->format)));
'snippet' => search_excerpt($keys, $node->body));
}
return $results;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment