Commit d720c661 authored by Steven Wittens's avatar Steven Wittens

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

parent d9d4b9bd
......@@ -562,6 +562,17 @@ function node_search($op = 'search', $keys = null) {
$results = array();
foreach ($find as $item) {
$node = node_load($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'),
......
......@@ -562,6 +562,17 @@ function node_search($op = 'search', $keys = null) {
$results = array();
foreach ($find as $item) {
$node = node_load($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'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment