[wp-trac] [WordPress Trac] #34475: get_comment_link incorrect page number in returned url.
WordPress Trac
noreply at wordpress.org
Thu Oct 29 12:17:47 UTC 2015
#34475: get_comment_link incorrect page number in returned url.
-------------------------------+------------------------------
Reporter: Property118 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: 4.3.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Comment (by Property118):
A further update, i can also confirm that on 4.3 changing the below solves
the issue.
From
{{{#!php
<?php
$comtypewhere = ( 'all' != $args['type'] &&
isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" .
$allowedtypes[$args['type']] . "'" : '';
// Count comments older than this one
$oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT
COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND
comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'"
. $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt )
);
}}}
To
{{{#!php
<?php
$comtypewhere = ( 'all' != $args['type'] &&
isset($allowedtypes[$args['type']]) ) ? " AND comment_type = '" .
$allowedtypes[$args['type']] . "'" : '';
// Count comments older than this one
$oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT
COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND
comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere,
$comment->comment_post_ID, $comment->comment_date_gmt ) );
}}}
So basically again removing the parent=0 clause fixes the issue.
Thanks
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34475#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list