Changeset 11557
- Timestamp:
- 05/17/2017 06:57:26 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-activity.php
r11447 r11557 190 190 } elseif ( ! empty( $changed['description']['old'] ) && ! empty( $changed['description']['new'] ) ) { 191 191 $action = sprintf( __( '%1$s changed the description of the group %2$s from "%3$s" to "%4$s"', 'buddypress' ), $user_link, $group_link, esc_html( $changed['description']['old'] ), esc_html( $changed['description']['new'] ) ); 192 193 } elseif ( ! empty( $changed['slug']['old'] ) && ! empty( $changed['slug']['new'] ) ) { 194 $action = sprintf( __( '%1$s changed the permalink of the group %2$s.', 'buddypress' ), $user_link, $group_link ); 192 195 193 196 } … … 462 465 } 463 466 464 if ( ! isset( $old_group->name ) || ! isset( $old_group-> description ) ) {467 if ( ! isset( $old_group->name ) || ! isset( $old_group->slug ) || ! isset( $old_group->description ) ) { 465 468 return false; 466 469 } … … 487 490 'old' => $old_group->name, 488 491 'new' => $group->name, 492 ); 493 } 494 495 if ( $group->slug !== $old_group->slug ) { 496 $changed['slug'] = array( 497 'old' => $old_group->slug, 498 'new' => $group->slug, 489 499 ); 490 500 } -
trunk/src/bp-groups/bp-groups-notifications.php
r11381 r11557 43 43 esc_html( $old_group->description ), 44 44 esc_html( $group->description ) 45 ); 46 } 47 48 if ( $group->slug !== $old_group->slug ) { 49 $changed[] = sprintf( 50 _x( '* Permalink changed from "%s" to "%s".', 'Group update email text', 'buddypress' ), 51 esc_url( bp_get_group_permalink( $old_group ) ), 52 esc_url( bp_get_group_permalink( $group ) ) 45 53 ); 46 54 } -
trunk/tests/phpunit/testcases/groups/activity.php
r11555 r11557 164 164 * @group bp_groups_format_activity_action_group_details_updated 165 165 */ 166 public function test_bp_groups_format_activity_action_group_details_updated_with_updated_slug() { 167 $old_user = get_current_user_id(); 168 $u = $this->factory->user->create(); 169 $this->set_current_user( $u ); 170 171 $group = $this->factory->group->create_and_get(); 172 groups_edit_base_group_details( array( 173 'group_id' => $group->id, 174 'name' => $group->name, 175 'slug' => 'flaxen', 176 'description' => $group->description, 177 'notify_members' => true, 178 ) ); 179 $new_group_details = groups_get_group( $group->id ); 180 181 $a = bp_activity_get( array( 182 'component' => buddypress()->groups->id, 183 'action' => 'group_details_updated', 184 'item_id' => $group->id, 185 ) ); 186 187 $this->assertNotEmpty( $a['activities'] ); 188 189 $expected = sprintf( __( '%s changed the permalink of the group %s.', 'buddypress' ), bp_core_get_userlink( $u ), '<a href="' . bp_get_group_permalink( $new_group_details ) . '">' . $group->name . '</a>' ); 190 $this->assertSame( $expected, $a['activities'][0]->action ); 191 192 $this->set_current_user( $old_user ); 193 } 194 195 /** 196 * @group activity_action 197 * @group bp_groups_format_activity_action_group_details_updated 198 */ 166 199 public function test_bp_groups_format_activity_action_group_details_updated_with_updated_name_and_description() { 167 200 $old_user = get_current_user_id();
Note: See TracChangeset
for help on using the changeset viewer.