Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/25/2018 11:12:06 PM (7 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-templates/bp-nouveau/includes/groups/ajax.php

    r12107 r12126  
    108108
    109109            } else {
    110                 groups_record_activity(
    111                     array(
    112                         'type'    => 'joined_group',
    113                         'item_id' => $group->id,
    114                     )
    115                 );
     110                if ( bp_is_active( 'activity' ) ) {
     111                    groups_record_activity(
     112                        array(
     113                            'type'    => 'joined_group',
     114                            'item_id' => $group->id,
     115                        )
     116                    );
     117                }
    116118
    117119                // User is now a member of the group
Note: See TracChangeset for help on using the changeset viewer.