From what I could see, seems that cant access to the $comment_count variable in the user profile page.
Also because the comments output is taken as #markup and not as an array.

I think we can just add 'comment_count' => $profile_comment->comment_count, in $account->content['user_profile_comments']array and under the user_profile_comments_user_view($account) hook

That becomes like this:

  // Add user profile elements.
  $account->content['user_profile_comments'] += array(
    '#type' => 'user_profile_category',
    '#attributes' => array('class' => array('user-profile-comments')),
    '#weight' => 5,
    '#title' => t('Comments'),
    'comment_count' => $profile_comment->comment_count,
  );
CommentFileSizeAuthor
#3 Add-comment_count-2550301-3.patch538 bytesdarkdim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

hanser created an issue. See original summary.

darkdim’s picture

Assigned: » darkdim
darkdim’s picture

Assigned: darkdim » Unassigned
Status: Active » Needs review
FileSize
538 bytes

Add comment_count

sanchiz’s picture

  • sanchiz committed 5f144ef on 7.x-1.x
    Issue #2550301 by darkdim, hanser: Move variable into separate element
    
  • sanchiz committed 6fb3cb0 on 7.x-1.x authored by darkdim
    Issue #2550301 by darkdim, hanser: $comment_count
    
sanchiz’s picture

Status: Needs review » Fixed

Thank you, guys! Committed and refactored a little.

Available now in 7.x-1.x-dev or in 7.x-1.1 and later once released.

Status: Fixed » Closed (fixed)

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