Commit 6afea0a0 authored by webchick's avatar webchick

#564642 by Scott Reynolds, Damien Tournoud, matt2000, and moshe weitzman:...

#564642 by Scott Reynolds, Damien Tournoud, matt2000, and moshe weitzman: Remove previous content property from build functions so artifacts do not persist.
parent 1a7c7dd1
...@@ -839,9 +839,8 @@ function comment_build($comment, stdClass $node, $build_mode = 'full') { ...@@ -839,9 +839,8 @@ function comment_build($comment, stdClass $node, $build_mode = 'full') {
* Build mode, e.g. 'full', 'teaser'... * Build mode, e.g. 'full', 'teaser'...
*/ */
function comment_build_content($comment, stdClass $node, $build_mode = 'full') { function comment_build_content($comment, stdClass $node, $build_mode = 'full') {
if (empty($comment->content)) { // Remove previously built content, if exists.
$comment->content = array(); $comment->content = array();
}
// Build comment body. // Build comment body.
$comment->content['comment_body'] = array( $comment->content['comment_body'] = array(
......
...@@ -1180,6 +1180,9 @@ function node_build($node, $build_mode = 'full') { ...@@ -1180,6 +1180,9 @@ function node_build($node, $build_mode = 'full') {
* *
*/ */
function node_build_content(stdClass $node, $build_mode = 'full') { function node_build_content(stdClass $node, $build_mode = 'full') {
// Remove previously built content, if exists.
$node->content = array();
// The 'view' hook can be implemented to overwrite the default function // The 'view' hook can be implemented to overwrite the default function
// to display nodes. // to display nodes.
if (node_hook($node, 'view')) { if (node_hook($node, 'view')) {
...@@ -1187,9 +1190,6 @@ function node_build_content(stdClass $node, $build_mode = 'full') { ...@@ -1187,9 +1190,6 @@ function node_build_content(stdClass $node, $build_mode = 'full') {
} }
// Build fields content. // Build fields content.
if (empty($node->content)) {
$node->content = array();
};
$node->content += field_attach_view('node', $node, $build_mode); $node->content += field_attach_view('node', $node, $build_mode);
// Always display a read more link on teasers because we have no way // Always display a read more link on teasers because we have no way
......
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