Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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,
);
Comment | File | Size | Author |
---|---|---|---|
#3 | Add-comment_count-2550301-3.patch | 538 bytes | darkdim |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedhanser created an issue. See original summary.
Comment #2
darkdimComment #3
darkdimAdd comment_count
Comment #4
sanchiz CreditAttribution: sanchiz at FFW, Five Jars, Drupal Ukraine Community for Drupal Ukraine Community commentedComment #6
sanchiz CreditAttribution: sanchiz at FFW, Five Jars, Drupal Ukraine Community for Drupal Ukraine Community commentedThank 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.