Commit 27e01ade authored by Dries's avatar Dries

- Patch #350984 by Moshe: clean-up and bugfix of the 'kick comment rendering out of node module'.

parent fb2c693f
......@@ -1983,7 +1983,7 @@ function template_preprocess_node(&$variables) {
$variables['name'] = theme('username', $node);
$variables['node_url'] = url('node/' . $node->nid);
$variables['title'] = check_plain($node->title);
$variables['page'] = (bool)menu_get_object();
$variables['page'] = (bool)menu_get_object();
if ($node->build_mode == NODE_BUILD_PREVIEW) {
unset($node->content['links']);
......@@ -1996,7 +1996,7 @@ function template_preprocess_node(&$variables) {
$variables['links'] = !empty($node->content['links']) ? drupal_render($node->content['links']) : '';
// Render any comments.
$variables['comments'] = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : '';
$variables['comments'] = !empty($node->content['comments']) ? drupal_render($node->content['comments']) : '';
// Render the rest of the node into $content.
if (!empty($node->content['teaser'])) {
......
......@@ -495,7 +495,7 @@ function comment_nodeapi_view($node, $teaser) {
);
// Append the list of comments to $node->content for node detail pages.
if ($node->comment && (bool)menu_get_object()) {
if ($node->comment && (bool)menu_get_object() && $node->build_mode != NODE_BUILD_PREVIEW) {
$node->content['comments'] = array(
'#markup' => comment_render($node),
);
......
......@@ -366,7 +366,7 @@ function hook_nodeapi_update_index($node) {
}
/**
* The user has finished editing the node and is trying to preview or submit it.
* The user has finished editing the node and is previewing or submitting it.
*
* This hook can be used to check the node data. Errors should be set with
* form_set_error().
......
......@@ -10,9 +10,9 @@
<div class="taxonomy"><?php print $terms ?></div>
<div class="content"><?php print $content ?></div>
<?php if ($links): ?>
<div class="links">&raquo; <?php print $links ?></div>
<div class="links">&raquo; <?php print $links ?></div>
<?php endif; ?>
<?php print $comments; ?>
<?php endif; ?>
</div>
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