Skip to:
Content

BuddyPress.org

Changeset 8316


Ignore:
Timestamp:
04/24/2014 01:04:43 AM (10 years ago)
Author:
boonebgorges
Message:

Ensure that existing 'description' is not wiped out when running groups_create_group() with an existing group

Fixes #5576

Location:
trunk
Files:
2 edited

Legend:

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

    r8157 r8316  
    102102        $name  = ! empty( $name ) ? $name : $group->name;
    103103        $slug  = ! empty( $slug ) ? $slug : $group->slug;
     104        $description = ! empty( $description ) ? $description : $group->description;
    104105
    105106        // Groups need at least a name
  • trunk/tests/testcases/groups/functions.php

    r8200 r8316  
    272272
    273273    /**
     274     * @group groups_create_group
     275     */
     276    public function test_groups_create_group_dont_delete_description_for_existing_group_when_no_description_is_passed() {
     277        $g = $this->factory->group->create();
     278
     279        $group_before = groups_get_group( array(
     280            'group_id' => $g,
     281        ) );
     282
     283        groups_create_group( array(
     284            'group_id' => $g,
     285            'enable_forum' => 1,
     286        ) );
     287
     288        $group_after = groups_get_group( array(
     289            'group_id' => $g,
     290        ) );
     291
     292        $this->assertSame( $group_before->description, $group_after->description );
     293    }
     294
     295    /**
    274296     * @group groupmeta
    275297     * @ticket BP5180
Note: See TracChangeset for help on using the changeset viewer.