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

Actions #1

Updated by Raymond Hoh 7 months ago

  • Status changed from New to Resolved

Fixed in and pushed to production. I've also created a BP Trac ticket here .

Actions #2

Updated by Raymond Hoh 7 months ago

Just wanted to update this ticket to mention that four groups were created since the release of CAC 2.2.0:

| id   | slug                                                              | date_created        |
| 3151 | sp-cuny-working-group-1576728188                                  | 2023-11-05 19:49:49 |
| 3150 | sp-cuny-working-group-693359538                                   | 2023-11-05 19:46:30 |
| 3149 | sp-cuny-working-group                                             | 2023-11-05 19:44:58 |
| 3148 | department-of-communications-performing-arts                      | 2023-10-26 03:26:37 |

It's more like two groups since the SP CUNY Working Group one probably went through the group creation process again after the fatal error popped up.

Actions #3

Updated by Boone Gorges 7 months ago

  • Has duplicate Bug #19239: Error occured when creating a group in CDev added

Also available in: Atom PDF