Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/25/2018 11:12:06 PM (6 years ago)
Author:
r-a-y
Message:

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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/actions/create.php

    r11923 r12126  
    183183
    184184            // Once we completed all steps, record the group creation in the activity stream.
    185             groups_record_activity( array(
    186                 'type' => 'created_group',
    187                 'item_id' => $bp->groups->new_group_id
    188             ) );
     185            if ( bp_is_active( 'activity' ) ) {
     186                groups_record_activity( array(
     187                    'type' => 'created_group',
     188                    'item_id' => $bp->groups->new_group_id
     189                ) );
     190            }
    189191
    190192            /**
Note: See TracChangeset for help on using the changeset viewer.