[wp-trac] Re: [WordPress Trac] #9069: Function get_comment_link returns duplicate URLs for comments available at permalink

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 10 15:09:29 GMT 2009


#9069: Function get_comment_link returns duplicate URLs for comments available at
permalink
---------------------------+------------------------------------------------
 Reporter:  GregMulhauser  |       Owner:  Viper007Bond  
     Type:  enhancement    |      Status:  new           
 Priority:  normal         |   Milestone:  Future Release
Component:  Comments       |     Version:  2.7.1         
 Severity:  normal         |    Keywords:                
---------------------------+------------------------------------------------

Comment(by GregMulhauser):

 Yes, get_page_of_comment() might be doing the job it was designed to do --
 however the design decision to return an integer when paging is enabled
 but '''paging is not necessary''' is forcing other functions to pick up
 the slack with extra DB queries if they want to avoid entirely unnecessary
 duplicate content issues. In other words, design things differently, and
 all the problems go away -- but as you have insisted multiple times now,
 "there's nothing wrong with get_page_of_comment()". I'm hearing loud and
 clear that there is little or no interest in evaluating whether the basic
 design itself is doing it's job, and little or no receptivity to positive
 contributions to helping WordPress do a better job.

 (With regard to whether I realize how comment paging works, I'm not sure
 how that bears on the design issue and the problems which it has created.
 In case you didn't realize, I've spent a fair bit of time with your code,
 too -- see Greg's Threaded Comment Numbering plugin. Yeah, it's still a
 bit rough around the edges, hasn't even been nicely OOP wrapped yet, but
 maybe you can tell the pains I've gone to in order to interact with what
 is at times deeply problematic code.)

 You mentioned "full plans on re-writing part of get_comment_link()" so it
 can be filtered, which will render the design decisions (but unfortunately
 not their performance ramifications) moot -- whether poor or otherwise.
 Here's a trivial change for line 475 of comment-template.php which will do
 the trick:

 {{{
 return apply_filters('get_comment_link',user_trailingslashit(
 trailingslashit( get_permalink( $comment->comment_post_ID ) ) .
 'comment-page-' . $args['page'], 'comment' ) . '#comment-' .
 $comment->comment_ID);
 }}}

 I leave it to you folks to decide whether to fix it -- or even whether
 just to insist it all works exactly as designed and so there's really no
 need to look at anything critically or with a view to improving it. Bye
 for now.

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


More information about the wp-trac mailing list