Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/25/2019 02:42:31 PM (6 years ago)
Author:
boonebgorges
Message:

Groups: Improved group detection when updating settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/screens/single/admin/group-settings.php

    r11923 r12381  
    4141            return false;
    4242
     43        $group_id = bp_get_current_group_id();
     44
    4345        /*
    4446         * Save group types.
     
    4648         * Ensure we keep types that have 'show_in_create_screen' set to false.
    4749         */
    48         $current_types = bp_groups_get_group_type( bp_get_current_group_id(), false );
     50        $current_types = bp_groups_get_group_type( $group_id, false );
    4951        $current_types = array_intersect( bp_groups_get_group_types( array( 'show_in_create_screen' => false ) ), (array) $current_types );
    5052        if ( isset( $_POST['group-types'] ) ) {
     
    5254
    5355            // Set group types.
    54             bp_groups_set_group_type( bp_get_current_group_id(), $current_types );
     56            bp_groups_set_group_type( $group_id, $current_types );
    5557
    5658        // No group types checked, so this means we want to wipe out all group types.
     
    6466
    6567            // Set group types.
    66             bp_groups_set_group_type( bp_get_current_group_id(), $current_types );
     68            bp_groups_set_group_type( $group_id, $current_types );
    6769        }
    6870
    69         if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
     71        if ( ! groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status ) ) {
    7072            bp_core_add_message( __( 'There was an error updating group settings. Please try again.', 'buddypress' ), 'error' );
    7173        } else {
Note: See TracChangeset for help on using the changeset viewer.