Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/30/2011 01:52:22 PM (13 years ago)
Author:
boonebgorges
Message:

Ensure that integrated bbPress forums have not been uninstalled before updating forum data on group edit. Fixes #3605

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-forums.php

    r4961 r5192  
    2424}
    2525
     26/**
     27 * Updates group forum metadata (title, description, slug) when the group's details are edited
     28 *
     29 * @package BuddyPress
     30 * @subpackage Groups
     31 *
     32 * @param int $group_id Group id, passed from groups_details_updated
     33 */
    2634function groups_update_group_forum( $group_id ) {
    2735
    2836    $group = new BP_Groups_Group( $group_id );
    2937
    30     if ( empty( $group->enable_forum ) || !bp_is_active( 'forums' ) )
     38    /**
     39     * Bail in the following three situations:
     40     *  1. Forums are not enabled for this group
     41     *  2. The BP Forum component is not enabled
     42     *  3. The built-in bbPress forums are not correctly installed (usually means they've been
     43     *     uninstalled)
     44     */
     45    if ( empty( $group->enable_forum ) || !bp_is_active( 'forums' ) || ( function_exists( 'bp_forums_is_installed_correctly' ) && !bp_forums_is_installed_correctly() ) )
    3146        return false;
    3247
Note: See TracChangeset for help on using the changeset viewer.