Skip to:
Content

#7870 closed defect (bug) (fixed)

Groups - Fatal error when joining a group and when the Activity component is disabled

Reported by: r-a-y Owned by:
Milestone: 3.1.0 Priority: normal
Severity: normal Version: 3.0.0
Component: Groups Keywords: has-patch
Cc:

Description

In r11924, I conditionally loaded the bp-groups-activity.php file if the Activity component is active.

What I failed to check was the bp-groups-functions.php file.

When joining a group, there is a call to groups_record_activity() with no bp_is_active() check. This causes a fatal error if the Activity component is disabled:
https://buddypress.org/support/topic/go-back-to-2-9-4-issues-with-3-0-0/#post-273490

😢

Attachments (2)

7870.01.patch (643 bytes) - added by r-a-y 10 months ago.
7870.02.patch (2.7 KB) - added by r-a-y 10 months ago.
Fixes a couple of other instances where groups_record_activity() is called.

Download all attachments as: .zip

Change History (7)

@r-a-y
10 months ago

@r-a-y
10 months ago

Fixes a couple of other instances where groups_record_activity() is called.

#1 @r-a-y
10 months ago

In 12123:

Groups: Ensure 'last_activity' meta is updated when the Activity component is disabled.

In r11924, the bp-groups-activity.php file is loaded only if the Activity
component is disabled.

However, the groups_update_last_activity() function was in this file.
This function is needed to set the last_activity group meta entry. To
ensure the last_activity group meta entry is always updated, this commit
moves the groups_update_last_activity() function over to
bp-groups-functions.php.

Anti-props r-a-y.

See #7870 (3.x branch).

#2 @r-a-y
10 months ago

In 12124:

Groups: Ensure 'last_activity' meta is updated when the Activity component is disabled.

In r11924, the bp-groups-activity.php file is loaded only if the Activity
component is disabled.

However, the groups_update_last_activity() function was in this file.
This function is needed to set the last_activity group meta entry. To
ensure the last_activity group meta entry is always updated, this commit
moves the groups_update_last_activity() function over to
bp-groups-functions.php.

Anti-props r-a-y.

See #7870 (trunk).

#3 @r-a-y
10 months ago

In 12125:

Groups: Wrap groups_record_activity() calls with bp_is_active( 'activity' )

In r11924, the bp-groups-activity.php file is loaded only if the Activity
component is enabled.

However, the groups_record_activity() function is located in this file.
Because this function now relies on the Activity component, if the Activity
component is disabled, a fatal error can occur during certain group
actions. This commit addresses the problem by checking for the Activity
component before calling on the function.

Anti-props r-a-y.

See #7870 (3.x branch).

#4 @r-a-y
10 months ago

In 12126:

Groups: Wrap groups_record_activity() calls with bp_is_active( 'activity' )

In r11924, the bp-groups-activity.php file is loaded only if the Activity
component is enabled.

However, the groups_record_activity() function is located in this file.
Because this function now relies on the Activity component, if the Activity
component is disabled, a fatal error can occur during certain group
actions. This commit addresses the problem by checking for the Activity
component before calling on the function.

Anti-props r-a-y.

See #7870 (trunk).

#5 @r-a-y
10 months ago

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.