BuddyPress - Multiple Instances of Group Extension API

I've followed the steps listed at http://codex.buddypress.org/developer-docs/group-extension-api/ to create a BuddyPress plugin that goes through the following steps (note that the BP_Group_Extension classes are directly from the Codex, only changing their names and slugs) :

1) checks BuddyPress is active

2) requires a file that sets up:
class Group_Stats_Extension extends BP_Group_Extension

3) requires a file that sets up:
class Group_Spotlight_Extension extends BP_Group_Extension

4) requires a file that sets up group meta according to Codex:
http://codex.buddypress.org/developer-docs/how-to-edit-group-meta-tutorial/

5) bp_register_group_extension( 'Group_Stats_Extension' );

6) bp_register_group_extension( 'Group_Spotlight_Extension' );

7)
bp_group_meta_init();
add_action( ‘bp_include’, ‘bp_group_meta_init’ );
(Step 7 just runs the group meta function from Step 4)

My issue is that when accessing ‘groups/test-group/admin/stats’ everything disappears for my ‘spotlight’ extension. If I change around the order of the bp_register_group_extension() calls, the second group extension always disappears ONLY when in the admin of the first group extension.

Should I be loading these group extensions in separate plugins or maybe bp-custom.php? I've taken a gander at the source for the bp_register_group_extension() function and it doesn't accept a priority or multiple extensions. I don’t understand what would be causing this only on the first registered extension’s admin area, as everything works fine in all other extension areas..

  • adverse
    • Flash Drive

    Attached new screenshots, apparently tiffs are not supported in the forums :slight_smile:

    I've posted in BuddyPress forums along with others but have yet to receive a reply.. I thought the wealth of knowledge here at WPMU DEV would be helpful, as I saw some posts from WPMU DEV developers speaking on using the Group Extension API. Are there any WPMU DEV plugins that use this API? If so, maybe one of the developers could give some insight on how to resolve extension conflicts?

    I've been reading up on other plugins that utilize the Group Extension API, and I've seen comments about similar issues where the admin screens conflict with other plugins' group extensions. The comment thread here http://buddydev.com/buddypress/blog-categories-for-groups-plugin/ notes a similar issue a few times and it appears that this developer has made changes to fix it. I have browsed through this plugin's code and have not been able to find what his solutions have been.

  • adverse
    • Flash Drive

    Read more of the comment thread on the link I posted above.. Here was this developer's solution (which has been implemented in the current version of his plugin):

    Just for the sake of issue.

    here is the solution for admin menu disappearing with other plugins using group extension.

    put this line at the end of bcg-admin.php
    bp_register_group_extension( “BCG_Group_Extension” );

    and comment this line(245) in in blog-categories-for-group.php
    //add_action(“bp_include”,”bcg_register_extension”,1);

    That will fix it.

    Odd... because this "fix" follows the same structure as the example code I pulled from the BuddyPress Codex.

  • adverse
    • Flash Drive

    Nope..

    His "fix" was identical to how I had originally coded my extensions.

    In examining the $bp global, the other nav items do not exist when in the group->admin->stats page.

    Interesting note: it does not appear to always load the $this->nav_item_position from my constructors. It seems that its falling back to the default nav_item_position which == 81. I believe this only happens when I CAN actually see all of the nav items. I've been moving on to other parts of this project, but will follow up soon with some more precise info on this note.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.