[buddypress-trac] [BuddyPress Trac] #5552: bp_is_current_component_core() breaks subnav for plugins that register themselves in component array

buddypress-trac noreply at wordpress.org
Tue Aug 5 23:54:19 UTC 2014


#5552: bp_is_current_component_core() breaks subnav for plugins that register
themselves in component array
------------------------------------+------------------
 Reporter:  boonebgorges            |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  highest                 |   Milestone:  2.1
Component:  Core                    |     Version:
 Severity:  major                   |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by r-a-y):

 I appreciate the patch, boonebgorges.  However, I don't think this is a
 problem any more on fresh installs. (Just tested a fresh install myself.)

 In `bp_is_current_component_core()`, we grab the `'bp-active-components'`
 DB option and then do component checks against this.  This option is only
 supposed to have core BP components in its array.

 Somewhere in an older version of BP (haven't looked), it was possible for
 BP to save 3rd-party components into this DB option as well.  I'm guessing
 we were just saving anything that was registered into
 `$bp->active_components` into the `bp-active-components` DB option.  This
 led to the problem as `bp_is_current_component_core()` shouldn't be
 checking 3rd-party components at all.

 To be extra safe as well as for backward compatibility, we could:
 - Add a core function to return an array of BP core components.
 - Reference this function in `bp_is_current_component_core()` and do
 proper core component checks.

 This should fix the problem.  boonebgorges, what do you think?

 Also, to test, can you dump `bp_get_option( 'bp-active-components' )` on
 the problematic install and see if Invite Anyone or BP Docs is in that
 array?

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5552#comment:5>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list