Notice: Undefined variable: links in quote_comment_view() (line 85 of /sites/all/modules/quote/quote.module).

Comments

Cray Flatline’s picture

Same error appears on the site. Drupal 7.2

RogueM’s picture

same here. nothing to add.

trillex’s picture

This only happens for me if I am watching a node/comments I haven't activated Quote for.

RogueM’s picture

well spotted, that seems to be the case here too.

patoshi’s picture

same error!

troky’s picture

move curly bracket } from line 83 to line 88 (quote.module) to fix above notice.

Code should look like:

function quote_comment_view($comment) {
  if (user_access('post comments')) {
    $node = node_load($comment->nid);
    if (in_array($node->type, _quote_variable_get('node_types')) && $node->comment == COMMENT_NODE_OPEN) {
      $links['quote'] = array(
        'title' => t('quote'),
        'href' => "comment/reply/$node->nid/$comment->cid",
        'attributes' => array('title' => t('Quote this post in your reply.')),
        'query' => array('quote' => 1),
        'fragment' => 'comment-form'
      );

      $comment->content['links']['quote'] = array(
        '#links' => $links,
        '#attributes' => array('class' => array('links', 'inline'))
      );
    }
  }
}

Zen’s picture

Status: Active » Closed (duplicate)