Skip to:
Content

BuddyPress.org

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6606 closed defect (bug) (fixed)

Visibility issues with BP_Activity_List_Table::row_actions()

Reported by: tw2113's profile tw2113 Owned by: r-a-y's profile r-a-y
Milestone: 2.3.4 Priority: normal
Severity: normal Version: 2.3.3
Component: Core Keywords: has-patch
Cc:

Description

Fatal error: Access level to BP_Activity_List_Table::row_actions() must be public (as in class WP_List_Table) in /home/public_html/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php on line 1777

Scoped from https://www.reddit.com/r/Wordpress/comments/3j8lc7/unable_to_log_into_admin_dashboard_after_update/

Attachments (4)

6606.01.patch (974 bytes) - added by johnjamesjacoby 9 years ago.
6606.02.patch (2.5 KB) - added by imath 9 years ago.
6606.03.patch (2.0 KB) - added by imath 9 years ago.
6606.04.patch (1.4 KB) - added by r-a-y 9 years ago.

Download all attachments as: .zip

Change History (19)

#2 @johnjamesjacoby
9 years ago

A few things:

  • WP_List_Table::row_actions() is protected in 4.3, and as far back as [WP28493]
  • BuddyPress uses protected in Activity & Groups, but public in Members.
  • BuddyPress claims to support as far back to WordPress 3.8, but row_actions() was an assumed public method until WordPress 4.0.

Ways to address this:

  • Make BuddyPress's row_actions() methods public, which should still function on top of protected methods in WordPress 4.3 without fatal errors, though this should be tested to confirm. Debug notices here would be acceptable IMO, considering the circumstances.
  • Bump the support version to WordPress 4.0 in the next BuddyPress release (2.4) so this becomes a non-issue, support wise.
  • The base WP_List_Table class was always extended at our own risk, so we could, in theory, invent our own BP_List_Table base class that is essentially a copy of WP_List_Table but specialized to the needs of BuddyPress. This is a bad idea, but it's an option that may eventually be necessary if WP_List_Table support is never officially supported.

#3 follow-up: @DJPaul
9 years ago

BuddyPress uses protected in Activity & Groups, but public in Members.

BP_Groups_List_Table and BP_Activity_List_Table do not replace WP_List_Table::row_actions (though they use some actions and filters with a similar name). Only BP_Members_Admin replaces the method.

#4 in reply to: ↑ 3 @johnjamesjacoby
9 years ago

Replying to DJPaul:

BuddyPress uses protected in Activity & Groups, but public in Members.

BP_Groups_List_Table and BP_Activity_List_Table do not replace WP_List_Table::row_actions (though they use some actions and filters with a similar name). Only BP_Members_Admin replaces the method.

You reviewed & committed r-a-y's patch in r10065 & r10066 for #6465. It specifically states:

Override WP_List_Table::row_actions().

Am I missing something?

#5 follow-up: @r-a-y
9 years ago

BuddyPress claims to support as far back to WordPress 3.8, but row_actions() was an assumed public method until WordPress 4.0.

Boo Ray. This is a case where copying WP and not thinking of older installs goes terribly wrong!

Changing the row_actions() method visibility to public should fix this issue.

#6 in reply to: ↑ 5 @johnjamesjacoby
9 years ago

Replying to r-a-y:

Changing the row_actions() method visibility to public should fix this issue.

01 patch attached takes this approach.

#7 @imath
9 years ago

@johnjamesjacoby i think we cannot bump to 4.0 in 2.4 as we already posted about bumping to 3.8 in 2.4 > https://bpdevel.wordpress.com/2015/08/06/wp-version-compatibility-guidelines/ a month ago (#6258)

#8 follow-up: @imath
9 years ago

When testing .01.patch in 4.0 i got another fatal: Maximum function nesting level of '100' reached, aborting! in the Activity administration.
Groups Administration: no problem
When testing .01.patch in 3.9 i got another fatal: Call to undefined method BP_Activity_List_Table::get_primary_column_name() in the Activity administration.

So i'm suggesting .02.patch. I've tested it in: 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3 and trunk and i got no errors and no warnings.

It seems to fix the issue.

@imath
9 years ago

#9 @imath
9 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 2.3.4
  • Version set to 2.3.3

6606.03.patch is 6606.02.patch updated to latest trunk

@imath
9 years ago

#10 in reply to: ↑ 8 @r-a-y
9 years ago

Replying to imath:

When testing .01.patch in 4.0 i got another fatal: Maximum function nesting level of '100' reached, aborting! in the Activity administration.
Groups Administration: no problem
When testing .01.patch in 3.9 i got another fatal: Call to undefined method BP_Activity_List_Table::get_primary_column_name() in the Activity administration.

So i'm suggesting .02.patch. I've tested it in: 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.3 and trunk and i got no errors and no warnings.

It seems to fix the issue.

The fatal error is being caused by using BP trunk.

The problem was due to r10008, which was committed against trunk and referenced the get_primary_column_name() method, instead of get_default_primary_column_name().

However, r10007 is correct, but was only for 2.3-branch.

See r10095, which should fix this problem.

I would recommend 04.patch, which is basically 01.patch, but with updated phpDoc.

Version 1, edited 9 years ago by r-a-y (previous) (next) (diff)

@r-a-y
9 years ago

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


9 years ago

This ticket was mentioned in Slack in #buddypress by boone. View the logs.


9 years ago

#13 @r-a-y
9 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 10130:

Admin: Set row_actions() method to public for compatibility with older versions of WordPress.

Fixes a fatal error for those still using WordPress < 4.0.

Props johnjamesjacoby, imath.

Anti-props r-a-y.

Fixes #6606 (2.3-branch).

#14 @r-a-y
9 years ago

In 10131:

Admin: Set row_actions() method to public for compatibility with older versions of WordPress.

Fixes a fatal error for those still using WordPress < 4.0.

Props johnjamesjacoby, imath.

Anti-props r-a-y.

See #6606 (trunk).

#15 @DJPaul
8 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.