Index: /trunk/src/bp-groups/bp-groups-functions.php
===================================================================
--- /trunk/src/bp-groups/bp-groups-functions.php	(revision 11554)
+++ /trunk/src/bp-groups/bp-groups-functions.php	(revision 11555)
@@ -219,26 +219,74 @@
  * @since 1.0.0
  *
- * @param int    $group_id       ID of the group.
- * @param string $group_name     Name of the group.
- * @param string $group_desc     Description of the group.
- * @param bool   $notify_members Whether to send an email notification to group
- *                               members about changes in these details.
+ * @param array $args {
+ *     An array of optional arguments.
+ *     @type int    $group_id       ID of the group.
+ *     @type string $name           Name of the group.
+ *     @type string $slug           Slug of the group.
+ *     @type string $description    Description of the group.
+ *     @type bool   $notify_members Whether to send an email notification to group
+ *                                  members about changes in these details.
+ * }
  * @return bool True on success, false on failure.
  */
-function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $notify_members ) {
-
-	if ( empty( $group_name ) || empty( $group_desc ) )
-		return false;
-
-	$group     = groups_get_group( $group_id );
+function groups_edit_base_group_details( $args = array() ) {
+
+	// Backward compatibility with old method of passing arguments.
+	if ( ! is_array( $args ) || func_num_args() > 1 ) {
+		_deprecated_argument( __METHOD__, '2.9.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) );
+
+		$old_args_keys = array(
+			0 => 'group_id',
+			1 => 'name',
+			2 => 'description',
+			3 => 'notify_members',
+		);
+
+		$args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
+	}
+
+	$r = wp_parse_args( $args, array(
+		'group_id'       => bp_get_current_group_id(),
+		'name'           => null,
+		'slug'           => null,
+		'description'    => null,
+		'notify_members' => false,
+	) );
+
+	if ( ! $r['group_id'] ) {
+		return false;
+	}
+
+	$group     = groups_get_group( $r['group_id'] );
 	$old_group = clone $group;
 
-	$group->name        = $group_name;
-	$group->description = $group_desc;
-
-	if ( !$group->save() )
-		return false;
-
-	if ( $notify_members ) {
+	// Group name, slug and description can never be empty. Update only if provided.
+	if ( $r['name'] ) {
+		$group->name = $r['name'];
+	}
+	if ( $r['slug'] && $r['slug'] != $group->slug ) {
+		$group->slug = groups_check_slug( $r['slug'] );
+	}
+	if ( $r['description'] ) {
+		$group->description = $r['description'];
+	}
+
+	if ( ! $group->save() ) {
+		return false;
+	}
+
+	// Maybe update the "previous_slug" groupmeta.
+	if ( $group->slug != $old_group->slug ) {
+		/*
+		 * If the old slug exists in this group's past, delete that entry.
+		 * Recent previous_slugs are preferred when selecting the current group
+		 * from an old group slug, so we want the previous slug to be
+		 * saved "now" in the groupmeta table and don't need the old record.
+		 */
+		groups_delete_groupmeta( $group->id, 'previous_slug', $old_group->slug );
+		groups_add_groupmeta( $group->id, 'previous_slug', $old_group->slug );
+	}
+
+	if ( $r['notify_members'] ) {
 		groups_notification_group_updated( $group->id, $old_group );
 	}
@@ -253,5 +301,5 @@
 	 * @param bool            $notify_members Whether to send an email notification to members about the change.
 	 */
-	do_action( 'groups_details_updated', $group->id, $old_group, $notify_members );
+	do_action( 'groups_details_updated', $group->id, $old_group, $r['notify_members'] );
 
 	return true;
Index: /trunk/tests/phpunit/testcases/groups/activity.php
===================================================================
--- /trunk/tests/phpunit/testcases/groups/activity.php	(revision 11554)
+++ /trunk/tests/phpunit/testcases/groups/activity.php	(revision 11555)
@@ -56,5 +56,11 @@
 	public function test_bp_groups_format_activity_action_group_details_updated_with_no_change() {
 		$group = $this->factory->group->create_and_get();
-		groups_edit_base_group_details( $group->id, $group->name, $group->description, true );
+		groups_edit_base_group_details( array(
+				'group_id'       => $group->id,
+				'name'           => $group->name,
+				'slug'           => $group->slug,
+				'description'    => $group->description,
+				'notify_members' => true,
+		) );
 
 		$a = bp_activity_get( array(
@@ -73,5 +79,11 @@
 	public function test_bp_groups_format_activity_action_group_details_updated_with_notify_members_false() {
 		$group = $this->factory->group->create_and_get();
-		groups_edit_base_group_details( $group->id, 'Foo', $group->description, false );
+		groups_edit_base_group_details( array(
+			'group_id'       => $group->id,
+			'name'           => 'Foo',
+			'slug'           => $group->slug,
+			'description'    => $group->description,
+			'notify_members' => false,
+		) );
 
 		$a = bp_activity_get( array(
@@ -94,5 +106,11 @@
 
 		$group = $this->factory->group->create_and_get();
-		groups_edit_base_group_details( $group->id, 'Foo', $group->description, true );
+		groups_edit_base_group_details( array(
+			'group_id'       => $group->id,
+			'name'           => 'Foo',
+			'slug'           => $group->slug,
+			'description'    => $group->description,
+			'notify_members' => true,
+		) );
 
 		$a = bp_activity_get( array(
@@ -120,5 +138,11 @@
 
 		$group = $this->factory->group->create_and_get();
-		groups_edit_base_group_details( $group->id, $group->name, 'Bar', true );
+		groups_edit_base_group_details( array(
+			'group_id'       => $group->id,
+			'name'           => $group->name,
+			'slug'           => $group->slug,
+			'description'    => 'Bar',
+			'notify_members' => true,
+		) );
 
 		$a = bp_activity_get( array(
@@ -146,5 +170,11 @@
 
 		$group = $this->factory->group->create_and_get();
-		groups_edit_base_group_details( $group->id, 'Foo', 'Bar', true );
+		groups_edit_base_group_details( array(
+			'group_id'       => $group->id,
+			'name'           => 'Foo',
+			'slug'           => $group->slug,
+			'description'    => 'Bar',
+			'notify_members' => true,
+		) );
 
 		$a = bp_activity_get( array(
Index: /trunk/tests/phpunit/testcases/groups/functions.php
===================================================================
--- /trunk/tests/phpunit/testcases/groups/functions.php	(revision 11554)
+++ /trunk/tests/phpunit/testcases/groups/functions.php	(revision 11555)
@@ -712,3 +712,117 @@
 		$this->assertEquals( $g1, $group->id );
 	}
+
+	/**
+	 * @expectedDeprecated groups_edit_base_group_details
+	 * @group groups_edit_base_group_details
+	 */
+	public function test_groups_edit_base_group_details_test_backcompat_arguments() {
+		$g1 = $this->factory->group->create();
+		$name = 'Great Scott';
+		$description = 'A must-see in time for the holidays!';
+		groups_edit_base_group_details( $g1, $name, $description, false );
+
+		$expected = array(
+			'id'          => $g1,
+			'name'        => $name,
+			'description' => $description
+		);
+		$updated_group_object = groups_get_group( $g1 );
+		$updated = array(
+			'id'          => $updated_group_object->id,
+			'name'        => $updated_group_object->name,
+			'description' => $updated_group_object->description
+		);
+
+		$this->assertEqualSets( $expected, $updated );
+	}
+
+	/**
+	 * @group groups_edit_base_group_details
+	 */
+	public function test_groups_edit_base_group_details_test_new_arguments() {
+		$g1 = $this->factory->group->create();
+		$name = 'Great Scott';
+		$slug = 'what-about-it';
+		$description = 'A must-see in time for the holidays!';
+		groups_edit_base_group_details( array(
+				'group_id'       => $g1,
+				'name'           => $name,
+				'slug'           => $slug,
+				'description'    => $description,
+				'notify_members' => false,
+		) );
+
+		$expected = array(
+			'id'          => $g1,
+			'slug'        => $slug,
+			'name'        => $name,
+			'description' => $description
+		);
+		$updated_group_object = groups_get_group( $g1 );
+		$updated = array(
+			'id'          => $updated_group_object->id,
+			'slug'        => $updated_group_object->slug,
+			'name'        => $updated_group_object->name,
+			'description' => $updated_group_object->description
+		);
+
+		$this->assertEqualSets( $expected, $updated );
+	}
+
+	/**
+	 * @group groups_edit_base_group_details
+	 */
+	public function test_groups_edit_base_group_details_avoid_slug_collisions() {
+		$slug = 'circe';
+		$g1 = $this->factory->group->create( array( 'slug' => $slug ) );
+		$g2 = $this->factory->group->create( array( 'slug' => 'loom' ) );
+
+		// Attempt to use a duplicate slug.
+		groups_edit_base_group_details( array(
+				'group_id'       => $g2,
+				'slug'           => $slug,
+		) );
+
+		$updated_group_object = groups_get_group( $g2 );
+
+		$this->assertNotEquals( $slug, $updated_group_object->slug );
+	}
+
+	/**
+	 * @group groups_edit_base_group_details
+	 */
+	public function test_groups_edit_base_group_details_slug_no_change() {
+		$slug = 'circe';
+		$g1 = $this->factory->group->create( array( 'slug' => $slug ) );
+
+		// Make sure the slug doesn't get incremented when there's no change.
+		groups_edit_base_group_details( array(
+				'group_id'       => $g1,
+				'slug'           => $slug,
+		) );
+
+		$updated_group_object = groups_get_group( $g1 );
+
+		$this->assertEquals( $slug, $updated_group_object->slug );
+	}
+
+	/**
+	 * @group groups_edit_base_group_details
+	 */
+	public function test_groups_edit_base_group_details_slug_null_value() {
+		$slug = 'circe';
+		$g1 = $this->factory->group->create( array( 'slug' => $slug ) );
+
+		// Make sure the slug doesn't get changed when null is passed.
+		groups_edit_base_group_details( array(
+				'group_id'       => $g1,
+				'slug'           => null,
+		) );
+
+		$updated_group_object = groups_get_group( $g1 );
+
+		$this->assertEquals( $slug, $updated_group_object->slug );
+	}
+
 }
