Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 313797

template_preprocess_comment() is preparing the parent's author with the wrong comment's uid

$
0
0

Problem/Motivation

Was reviewing the template_preprocess_comment() function's code and noticed a bug. The parent comment author was being built off the wrong comment.

  if ($comment->pid->target_id) {
    // Fetch and store the parent comment information for use in templates.
    $comment_parent = $comment->pid->entity;
    $account_parent = comment_prepare_author($comment);
    $variables['parent_comment'] = $comment_parent;
    $variables['parent_author'] = theme('username', array('account' => $account_parent));

Proposed resolution

comment_prepare_author($comment);
should be
comment_prepare_author($comment_parent);

#1857946: Comment parent template variables are built twice


Viewing all articles
Browse latest Browse all 313797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>