As long as function node_view:

// We don't need duplicate rendering info in node->content.
  // We don't need duplicate rendering info in node->content.
  unset($node->content);

  $build += array(
    '#theme' => 'node',
    '#node' => $node,
    '#view_mode' => $view_mode,
  );

$node->content won't be defined in $variables['elements']['#node'] so this comprobation is uselesS:

  if (!empty($node->in_preview)) {
    unset($node->content['links']);
  }
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, template_preprocess_node.patch, failed testing.

jherencia’s picture

Status: Needs work » Needs review
FileSize
690 bytes

Reroll.

bleen’s picture

FileSize
817 bytes

I can confirm that when $node->in_preview == TRUE, there is no $node->content so this check is unnecessary

reroll...

Status: Needs review » Needs work

The last submitted patch, unneeded-if.patch, failed testing.

tobiasb’s picture

Status: Needs work » Needs review

#3: unneeded-if.patch queued for re-testing.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

The code we are removing does serve a purpose. Namely, it tries to remove node links during a Preview. That’s done because you can't actually add a comment and so on to a node thats not been created yet. Seems like the code is acting on the wrong variable though.

I'm fine with removing this, since removing node links during Preview is pretty edge case anyway.

sun’s picture

Version: 7.x-dev » 8.x-dev

Can be backported later.

catch’s picture

Issue tags: +Needs backport to D7

tagging for backport.

jherencia’s picture

Patch works for both branches.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x.

(Working from the road so can't review big complex issues right now -- picking away some smaller patches that are unlikely to break bigger patches.)

Status: Fixed » Closed (fixed)
Issue tags: -Needs backport to D7

Automatically closed -- issue fixed for 2 weeks with no activity.