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-groups/screens/user/invites.php

    r11923 r12126  
    2929            bp_core_add_message( sprintf( __( 'Group invite accepted. Visit %s.', 'buddypress' ), bp_get_group_link( $group ) ) );
    3030
    31             groups_record_activity( array(
    32                 'type'    => 'joined_group',
    33                 'item_id' => $group->id
    34             ) );
     31            if ( bp_is_active( 'activity' ) ) {
     32                groups_record_activity( array(
     33                    'type'    => 'joined_group',
     34                    'item_id' => $group->id
     35                ) );
     36            }
    3537        }
    3638
Note: See TracChangeset for help on using the changeset viewer.