[wp-trac] [WordPress Trac] #16842: class-wp-list-table.php on line 140

WordPress Trac wp-trac at lists.automattic.com
Sun Mar 13 03:57:38 UTC 2011


#16842: class-wp-list-table.php on line 140
--------------------------+------------------------------
 Reporter:  idbill        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Comments      |     Version:  3.1
 Severity:  critical      |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------
Description changed by scribu:

Old description:

> 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...

New description:

 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...

--

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


More information about the wp-trac mailing list