commit 6d3c64005f5e77fb68bdc13da577261fbd0017cf Author: Thomas Lattimore Date: Thu May 23 17:23:52 2013 -0700 Removing the unnecessary work within bartik_preprocess_node() and adjust the comment as requested. diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index 6bdd8e2..3815f13 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -114,17 +114,11 @@ function bartik_process_maintenance_page(&$variables) { * Implements hook_preprocess_HOOK() for node.html.twig. */ function bartik_preprocess_node(&$variables) { - // Operate on a copy of links in order to preserve the original. - $links = $variables['content']['links']; - - // Remove the "Add new comment" link on the teaser page or if the comment - // form is being displayed on the same page. + // Remove the "Add new comment" link on teasers or when the comment form is + // displayed on the page. if ($variables['teaser'] || !empty($variables['content']['comments']['comment_form'])) { - unset($links['comment']['#links']['comment-add']); + unset($variables['content']['links']['comment']['#links']['comment-add']); } - - // Render links to test if there is content present to display. - $variables['links'] = drupal_render($links); } /** diff --git a/core/themes/bartik/templates/node.html.twig b/core/themes/bartik/templates/node.html.twig index 09ec0a3..802092f 100644 --- a/core/themes/bartik/templates/node.html.twig +++ b/core/themes/bartik/templates/node.html.twig @@ -100,9 +100,9 @@ {{ content }} - {% if links %} + {% if content.links %} {% endif %}