[buddypress-trac] [BuddyPress Trac] #9237: [Site Health Info Tab] Some "Active components" are incorrect while viewing the BuddyPress panel

buddypress-trac noreply at wordpress.org
Fri Sep 27 16:41:19 UTC 2024


#9237: [Site Health Info Tab] Some "Active components" are incorrect while viewing
the BuddyPress panel
-------------------------------------------------+-------------------------
 Reporter:  emaralive                            |       Owner:  emaralive
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  14.2.0
Component:  Administration                       |     Version:  14.1.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots has-patch dev-       |
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by emaralive):

 @imath
 cc: @espellcaste

 I had BP Attachments installed on one of my local sites and activated it
 to observe the "**active_components**".

 * buddypress()->optional_components - doesn't get updated with Attachments
 component info.
 * buddypress()->deactivated_components - doesn't get updated when the
 Attachment component is disabled via BP Settings components tab.

 Without getting into the minutiae, what will work is the following, due to
 the way BP Attachments is adding itself as an optional component:

 {{{
 $all_components    = array_merge( bp_core_get_components( 'required' ),
 bp_core_get_components( 'optional' ) );
 $active_components = array_merge( buddypress()->active_components, array(
 'core' => '1' );
 $active_components = wp_list_pluck( array_intersect_key( $all_components,
 $active_components ), 'title' );
 }}}

 This produces an associative array that includes the **Attachments**
 component if active/enabled, the following is when active:
 {{{
 array(11) {
   ["core"]=>
   string(15) "BuddyPress Core"
   ["members"]=>
   string(17) "Community Members"
   ["xprofile"]=>
   string(17) "Extended Profiles"
   ["settings"]=>
   string(16) "Account Settings"
   ["friends"]=>
   string(18) "Friend Connections"
   ["messages"]=>
   string(17) "Private Messaging"
   ["activity"]=>
   string(16) "Activity Streams"
   ["notifications"]=>
   string(13) "Notifications"
   ["groups"]=>
   string(11) "User Groups"
   ["blogs"]=>
   string(13) "Site Tracking"
   ["attachments"]=>
   string(11) "Attachments"
 }
 }}}

 I believe we should have some conversations regarding !BuddyPress add-ons
 and how they get integrated into the component scheme of things which
 would help distinguish between built-in (which would include add-ons) &
 3rd party (or, how 3rd party can nicely integrate into the component side
 of things). I'm thinking all this needs to get documented so that all
 players involved know what and how things should get done, i.e., the rules
 of engagement.

 All said and done, I can upload a new patch (the example provided) which
 excludes 3rd party and other fluff (members-invitation) or we can discuss
 this further. At the moment, there are some items that I indicated that
 don't appear to work (the bulleted items): meaning why doesn't the BP
 Attachments behave like the built-in components. Plus, possibly fix the
 **{{{bp_attachments_get_component_info()}}}** callback (re: BP Attachment)
 to also include Attachment info when the **{{{type}}}** parameter is set
 to **{{{all}}}** or, maybe, I'm mistaken and there is a reason for the way
 it currently returns what it returns..

 Last but not least, I still need to look over #9098 to see what else might
 throw a monkey wrench into this "**Active Component**" situation.

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


More information about the buddypress-trac mailing list