Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 8 years ago

#4274 closed defect (bug) (fixed)

Error bp-group-hierarchy-classes.php on line 345

Reported by: jconti's profile j.conti Owned by:
Milestone: 1.6 Priority: normal
Severity: major Version: 1.6
Component: Core Keywords:
Cc:

Description

I activated/updated to BuddyPress 1.6 Beta 1

After the upgrade, the browser showed a white page with this error:

Fatal error: Cannot make static method BP_Groups_Group::group_exists() non static in class BP_Groups_Hierarchy in /home//public_html/wp-content/plugins/bp-group-hierarchy/bp-group-hierarchy-classes.php on line 345

Is a WordPress 3.4 Multisite

The site is now inaccessible, always shows that error.

Change History (13)

#1 @j.conti
12 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

Upss, sorry,

Is a plugin.

#2 @DJPaul
12 years ago

  • Component changed from Core to Backwards Compatability
  • Keywords close removed
  • Milestone changed from Awaiting Review to 1.6
  • Resolution invalid deleted
  • Severity changed from blocker to major
  • Status changed from closed to reopened

#3 @DJPaul
12 years ago

Thanks for the report. It's true that the error is reported from another the plugin, but a change in BuddyPress core broke it. So this is a backwards compatibility problem. It seems that in 1.6 we've gone through the BP_Groups_Group class and added the static function keyword to appropriate functions. At the very least, we need to un-static group_exists() but mark the function as static in the phpdoc.

I also think we should go through the entire BP_Groups_Group class, and take out any static keywords that are new in 1.6. (audit the other components' classes, too?)

#4 @boonebgorges
12 years ago

I also think we should go through the entire BP_Groups_Group class, and take out any static keywords that are new in 1.6. (audit the other components' classes, too?)

Yes. We should follow the WP practice of not changing the access levels on pre-PHP5 methods, for backpat reasons like this, but instead just putting it in the docblock.

#5 @boonebgorges
12 years ago

FWIW the same issue arises with any method access declaration (public, private, etc). These should be removed for all legacy methods. (The only real downside is that it'll cause warnings with E_STRICT turned on, but backward compatibility is far more important with existing components.)

#6 @boonebgorges
12 years ago

(In [6119]) Removes access declarations on legacy methods in bp-groups-classes.php

Prior versions of BuddyPress were written for PHP4 compatibility, which meant
that method visibility/access/static was not possible. WP and BP now require
PHP5, which means that new methods can use PHP5+ access declarations. However,
explicitly declaring 'static' or visibility on existing methods causes
backward compatibility issues, because any existing plugin that extends these
classes will throw fatal errors if they do not declare the same visibility/
static as the parent class.

See #4274

#7 @boonebgorges
12 years ago

(In [6120]) Removes static and access declarations on methods in bp-friends-classes.php

See #4274 and r6119

#8 @boonebgorges
12 years ago

(In [6121]) Removes static and access declarations on methods in bp-core-classes.php

See #4274 and r6119

#9 @boonebgorges
12 years ago

  • Version set to 1.6-beta

I'll call this fixed for now. If other instances arise, please open a new ticket. Thanks.

#10 @DJPaul
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

#11 @johnjamesjacoby
10 years ago

  • Component changed from Backwards Compatability to Warnings/Notices

#12 @johnjamesjacoby
10 years ago

  • Version changed from 1.6-beta to 1.6

#13 @DJPaul
8 years ago

  • Component changed from Tools - Warnings/Notices to Core
Note: See TracTickets for help on using tickets.