Ticket #722 (closed defect: worksforme)
Akismet display returns the same spam repeatedly because of indexing error
| Reported by: | engtech | Owned by: | matt |
|---|---|---|---|
| Priority: | normal | Component: | akismet |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I'm using WordPress.com and going to the Akismet section of edit-comments.php If you look at the comment ids for each page I can see:
page 1: 95097 to 95048, showing 49 comments page 2: 95047 to 94948, showing 99 comments page 3: 94997 to 94848, showing 149 comments page 4: 94947 to 94746, showing 201 comments page 5: 94897 to 94642, showing 251 comments page 6: 94847 to 94542, showing 305 comments ... page 15: 94390 to 93635, showing 755 comments page 16: 94339 to 93534, showing 805 comments ... page 86: 90778 to 89482, showing 1295 comments
The intent is to show 50 comments per page but because of an indexing bug it keeps repeating the same comments as you go through the pages.
Looking through http://svn.wp-plugins.org/akismet/trunk/akismet.php the problem didn't pop up at me.
The start/end delimiters look correct in the code base, but I'm not sure which version of the plugin wordpress.com is using.
$start = ( $page - 1 ) * 50;
$end = $start + 50;
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_approved = 'spam' ORDER BY comment_date DESC LIMIT $start, $end");
$total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = 'spam'" );

engtech, thank you for the detailed bug report. Using Firefox 2, I can't seem to reproduce it at this time, so I'm assuming that it was previously fixed. If you are still seeing this, please reopen, include what browser you are using, and exact steps to reproduce. Thanks!