[buddypress-trac] [BuddyPress] #2342: Blog Comment Link in Activity Stream Broken has ID# Twice

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed May 19 12:26:23 UTC 2010


#2342: Blog Comment Link in Activity Stream Broken has ID# Twice
-------------------------+--------------------------------------------------
 Reporter:  hotforwords  |        Owner:          
     Type:  defect       |       Status:  reopened
 Priority:  normal       |    Milestone:  1.2.4   
Component:  Core         |   Resolution:          
 Keywords:  has-patch    |  
-------------------------+--------------------------------------------------
Changes (by hotforwords):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 The 2974 fix is incorrect.  When PAGED COMMENTS are turned on in
 Wordpress, the link does not take you to the proper page with the proper
 comment.

 I have the proper fix:

 On line 429 take this code:

 {{{
 $comment_link = get_permalink( $comment->comment_post_ID ) . '#comment-' .
 $comment_id;
 }}}

 And change it to:

 {{{
 $comment_link = htmlspecialchars( get_comment_link( $comment->comment_ID )
 );
 }}}

 Then on line 430 take the code:

 {{{
 $activity_action = sprintf( __( '%s commented on the blog post %s',
 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' .
 $comment_link . '#comment-' . $comment->comment_ID . '">' .
 $comment->post->post_title . '</a>' );
 }}}

 And change it to:

 {{{
 $activity_action = sprintf( __( '%s commented on the blog post %s',
 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' .
 $comment_link . '">' . $comment->post->post_title . '</a>' );
 }}}

 Now, when paged comments are on, the link takes you directly to the
 comment on the correct page.

 Thanks!

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2342#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list