Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#6268 closed defect (bug) (fixed)

bp_has_activities() should check if the groups component is active before using one of its functions

Reported by: imath Owned by: imath
Milestone: 2.3 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch
Cc:

Description

Since r9536, bp_has_activities() is using groups_get_current_group() at line 625. The problem is: when the Groups component is not active, we get a fatal error as the function is not available.

I suggest to use a bp_is_active() check to avoid it.

Attachments (2)

6268.patch (625 bytes) - added by imath 5 years ago.
6268.02.patch (584 bytes) - added by imath 5 years ago.

Download all attachments as: .zip

Change History (4)

@imath
5 years ago

#1 @imath
5 years ago

Well actually, using bp_is_group() would be best, see .02.patch

@imath
5 years ago

#2 @imath
5 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 9569:

Activity: in bp_has_activities() use bp_is_group() instead of groups_get_current_group()

Since r9536, bp_has_activities() is using the groups_get_current_group() function, which needs the Groups component to be active. There can be cases when this component has not been activated by the community administrator. In such cases, using this function is generating a fatal error. Using bp_is_group() is avoiding this error.

Fixes #6268

Note: See TracTickets for help on using tickets.