Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16842 closed defect (bug) (worksforme)

class-wp-list-table.php on line 140

Reported by: idbill's profile idbill Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Comments Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by scribu)

3.1 recent install...
log in as admin...
then go to 'comments'...
the following error appears:

/home2/writinl4/public_html/angeltrivia/wp-admin/includes/class-wp-list-table.php on line 140

the if statement referenced is:

if ( !$args['total_pages'] && $args['per_page'] > 0 ) {
  $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );

I checked the variables, and they were set as so:

$args['total_pages'] = 0
$args['per_page'] = 20
$args['total_items'] = ( array of items )

Uh.. can't divide an array!

So I changed the if calculation to:

if ( !$args['total_pages'] && $args['per_page'] > 0 ) {
  $args['total_pages'] = ceil( count( $args['total_items'] ) / $args['per_page'] );

and it works...

Change History (5)

#1 @scribu
13 years ago

  • Description modified (diff)

#2 @scribu
13 years ago

  • Keywords reporter-feedback added

I go to 'Comments' and it shows up just fine. Are you sure it's not a plugin messing with the comments screen?

#3 @solarissmoke
13 years ago

  • Keywords close added; needs-patch removed
  • Severity changed from critical to normal

#4 @dd32
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Tracing $args['total_items'] back, it is set by get_comments( ..count = true ); the only way I can see this happening is with an out of date wp-includes/comment.php (Or of course, a plugin messing with things it shouldn't).

Feel free to re-open this ticket with extra details to reproduce it.

#5 @hakre
13 years ago

  • Keywords close removed
Note: See TracTickets for help on using tickets.