[wp-trac] [WordPress Trac] #58789: Not countable. row_actions @ /wp-admin/includes/class-wp-list-table.php

WordPress Trac noreply at wordpress.org
Mon Oct 30 19:20:10 UTC 2023


#58789: Not countable.  row_actions @  /wp-admin/includes/class-wp-list-table.php
----------------------------+------------------------------
 Reporter:  Nate1           |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  6.2
 Severity:  major           |  Resolution:
 Keywords:  needs-patch     |     Focuses:
----------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => needs-patch
 * component:  General => Administration


Old description:

> Commonly getting not countable for the users lists, across many sites not
> sure of the source of the issue, but easy solution seems to be to modify.
>
> /wp-admin/includes/class-wp-list-table.php
>
> protected function row_actions( $actions, $always_visible = false )
> ++ if(!isset($actions)) { return ''; }
>
> $action_count = count( $actions );
> if ( ! $action_count ) {
> return '';
> }

New description:

 Commonly getting not countable for the users lists, across many sites not
 sure of the source of the issue, but easy solution seems to be to modify.

 `/wp-admin/includes/class-wp-list-table.php`

 {{{
 protected function row_actions( $actions, $always_visible = false )
 ++ if(!isset($actions)) { return ''; }

 $action_count = count( $actions );
 if ( ! $action_count ) {
 return '';
 }
 }}}

--

Comment:

 I think the problem might come from the `user_row_actions` filter
 returning `false` or an empty string, and then the `$actions` variable
 would be set but uncountable. Maybe `row_actions()` could check
 `is_countable` instead.

 {{{
 $action_count = is_countable( $actions ) ? count( $actions ) : 0;
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58789#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list