Skip to:
Content

BuddyPress.org

Opened 5 months ago

Closed 6 weeks ago

#9181 closed defect (bug) (fixed)

Improve check for BP Classic Plugin

Reported by: samedwards's profile samedwards Owned by: imath's profile imath
Milestone: 15.0.0 Priority: normal
Severity: normal Version: 12.5.1
Component: Core Keywords: has-patch
Cc:

Description

Right now, checks for the BP classic plugin are done with a function_exists( 'bp_classic' ) conditional, which is checking for the existence of this function as defined in the BP Classic plugin. This relies on the alphabetical ordering of the active_plugins array (and of course the sorting of bp-classic before buddypress).

I ran across a situation where I was enabling the BP Classic plugin via a plugin manifest, which did not cause the active_plugins array to be sorted, and thus I got redefined function errors when BP Classic loaded after Buddypress.

A check to is_plugin_active() has the downside of requiring the BP Classic plugin to be installed in the correctly named folder, which is also not always a given, but I would suggest that the gating conditional being changed to function_exists() || is_plugin_active() should cover more possible circumstances.

Change History (10)

#1 @espellcaste
5 months ago

  • Milestone changed from Awaiting Review to Up Next

@imath could you look into this?

#2 @imath
5 months ago

  • Owner set to imath
  • Status changed from new to assigned

Absolutely, thanks for alerting me about it 👌

#3 @imath
4 months ago

  • Milestone changed from Up Next to 15.0.0

#4 @espellcaste
3 months ago

  • Keywords needs-patch added

#5 @espellcaste
3 months ago

  • Priority changed from normal to low
  • Type changed from defect (bug) to enhancement

This ticket was mentioned in PR #371 on buddypress/buddypress by @narenin.


2 months ago
#6

  • Keywords has-patch added; needs-patch removed

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


6 weeks ago

#8 @espellcaste
6 weeks ago

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

In 14029:

Update the conditional that check if bp_classic is available.

Previously, we only checked if the bp_classic function was available, without checking if the plugin was also active.

Props imath, narenin, samedwards, and espellcaste.

Fixes #9181
Closes https://github.com/buddypress/buddypress/pull/371

#9 @imath
6 weeks ago

  • Priority changed from low to normal
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Type changed from enhancement to defect (bug)

Unit tests are failing since this commit, we need to review the fix. See:

https://github.com/buddypress/buddypress/commit/f351427acb60fc7e62452f1448586af18bd72d20

#10 @imath
6 weeks ago

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

In 14032:

Remove the is_plugin_active() polyfill

Fixes #9181

Note: See TracTickets for help on using tickets.