Bug #19214


Group creation is causing a fatal error

Added by Raymond Hoh 7 months ago. Updated 7 months ago.

Priority name:
Category name:
Groups (misc)
Target version:
Start date:
Due date:
% Done:


Estimated time:
Deployment actions:


While looking into #19202, I found that group creation is broken. On the group creation page, if you click on the "Create Group and Continue" button, you will get a fatal error.

tl;dr: The bug is with the cac-group-library plugin and how it attempts to modify a group's navigation to remove some nav menu items. The bug only came about once we made our bp-nelo theme its own theme in CAC 2.2.0.

Boone, here's the rundown:
1. Before CAC 2.2.0, bp-nelo was a child theme of bp-default. When loading a BuddyPress template, all code execution stops after the template is loaded:

2. In CAC 2.2.0, bp-nelo is its own theme so BuddyPress's theme compat layer kicks in. However, BP theme compat doesn't halt code execution after a template is loaded:

3. This led to the following on the group creation page:
i. When a BuddyPress group is created, it sets the buddypress()->groups->current_group property to the new group's details: . This code runs on 'bp_actions' at priority 10.

ii. The 'cac-group-library' plugin attemps to alter a group's nav menu and it does a check for bp_is_group() to determine if we're on a single group page: This code runs on 'bp_actions' at priority 200. When this code runs at priority 200, bp_is_group() is returning true due to 3)i: .

iii. Due to bp_is_group() returning true, the cac-group-library plugin attempts to access some group nav class methods that only exist on a single group page . This causes the fatal error.

I've patched up the cac-group-library nav removal code to run on 'bp_actions' at priority 9 to sidestep the bp_is_group() problem and will create a ticket over on BuddyPress Trac to let devs know how bp_is_group() can potentially be true on the group creation page.

Related issues

Has duplicate CUNY Academic Commons - Bug #19239: Error occured when creating a group in CDevResolvedRaymond Hoh2023-11-09


Also available in: Atom PDF