[wp-trac] [WordPress Trac] #12217: get_comment_reply_link gets post ID from wrong place

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 24 17:28:24 UTC 2010


#12217: get_comment_reply_link gets post ID from wrong place
--------------------------+-------------------------------------------------
 Reporter:  juggledad     |       Owner:       
     Type:  defect (bug)  |      Status:  new  
 Priority:  normal        |   Milestone:  3.0  
Component:  General       |     Version:  2.9.1
 Severity:  normal        |    Keywords:       
--------------------------+-------------------------------------------------

Comment(by juggledad):

 The doc for this routine states '@param int $post Optional. Post that the
 comment is going to be displayed on.' There fore I should be able to call
 this routine without $post. If that is true, then you need to get the post
 ID from the comment. This is eithor a bug in this code or the
 documentation needs to be changed to make $post a REQUIRED parameter
 instead of an OPTIONAL.

 The Atahualpa Theme ends up calling this routine when adding comments to
 PAGES (an option the theme allows) and the $post is not being passed thus
 causing an error.

 Changing the code so the the routine gets the post ID from the comment
 takes care of both cases, weither you pass teh $post or not and gaurentees
 that the correct post is associated with the comment.

 Therotically, I could get a comment for post 'A', then get post 'B' and
 then call this routine. With the code the way it is, the comment reply
 would be tied to post 'B' and not post 'A' as it should be. With the
 change, the comment reply would be associated with the correct post ie
 'A'.

 granted this is a made up case, but it issustrates why the routine needs
 to get the post ID from the comment_post_ID

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12217#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list