Index: node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.761 diff -u -p -r1.761 node.module --- node.module 26 Dec 2006 00:29:49 -0000 1.761 +++ node.module 29 Dec 2006 20:56:34 -0000 @@ -669,7 +669,7 @@ function node_save(&$node) { function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { $node = (object)$node; - $node = node_build_content($node, $teaser, $page); + node_build_content($node, $teaser, $page); if ($links) { $node->links = module_invoke_all('link', 'node', $node, !$page); @@ -701,7 +701,7 @@ function node_view($node, $teaser = FALS /** * Apply filters and build the node's standard elements. */ -function node_prepare($node, $teaser = FALSE) { +function node_prepare(&$node, $teaser = FALSE) { // First we'll overwrite the existing node teaser and body with // the filtered copies! Then, we'll stick those into the content // array and set the read more flag if appropriate. @@ -719,40 +719,34 @@ function node_prepare($node, $teaser = F '#weight' => 0, ); - return $node; } /** * Builds a structured array representing the node's content. * - * @param $node - * A node object. + * @param &$node + * A node object reference. * @param $teaser * Whether to display the teaser only, as on the main page. * @param $page * Whether the node is being displayed by itself as a page. - * - * @return - * An structured array containing the individual elements - * of the node's body. */ -function node_build_content($node, $teaser = FALSE, $page = FALSE) { +function node_build_content(&$node, $teaser = FALSE, $page = FALSE) { // Remove the delimiter (if any) that separates the teaser from the body. $node->body = str_replace('', '', $node->body); // The 'view' hook can be implemented to overwrite the default function // to display nodes. if (node_hook($node, 'view')) { - $node = node_invoke($node, 'view', $teaser, $page); + node_invoke($node, 'view', $teaser, $page); } else { - $node = node_prepare($node, $teaser); + node_prepare($node, $teaser); } // Allow modules to make their own additions to the node. node_invoke_nodeapi($node, 'view', $teaser, $page); - return $node; } /** @@ -913,7 +907,7 @@ function node_search($op = 'search', $ke foreach ($find as $item) { // Build the node body. $node = node_load($item->sid); - $node = node_build_content($node, FALSE, FALSE); + node_build_content($node, FALSE, FALSE); $node->body = drupal_render($node->content); // Fetch comments for snippet @@ -1784,7 +1778,7 @@ function node_feed($nodes = 0, $channel node_invoke($item, 'view', $teaser, FALSE); } else { - $item = node_prepare($item, $teaser); + node_prepare($item, $teaser); } // Allow modules to change $node->teaser before viewing. @@ -2437,7 +2431,7 @@ function node_update_index() { $node = node_load($node->nid); // Build the node body. - $node = node_build_content($node, FALSE, FALSE); + node_build_content($node, FALSE, FALSE); $node->body = drupal_render($node->content); $text = '

'. check_plain($node->title) .'

'. $node->body;