Skip to:
Content

BuddyPress.org

#8089 closed enhancement (fixed)

Improve Groups activity action formatting

Reported by: imath Owned by: imath
Milestone: 5.0.0 Priority: normal
Severity: normal Version:
Component: Groups Keywords: has-patch has-unit-tests
Cc:

Description

  • Introduce a function to try to get the current group if the activity is displayed into its activity page before requesting the group thanks to the activity's item_id.
  • Introduce a new Activity type for activities posted within Groups to make sure Group activites are using this type's format callback (otherwise the activities posted within groups have no format callback).
  • Make sure this new activity type does not interfere with the regular activity_update type within activity stream filters (front-end and back-end).
  • Move the groups_post_update() from src/bp-groups/bp-groups-functions.php to src/bp-groups/bp-groups-activity.php.

Attachments (2)

8089.patch (15.5 KB) - added by imath 18 months ago.
8089.2.patch (19.4 KB) - added by imath 18 months ago.

Download all attachments as: .zip

Change History (4)

@imath
18 months ago

#1 @imath
18 months ago

  • Keywords has-unit-tests added

In 8089.2.patch:

  • I've added a unit test for the new activity action formatting function bp_groups_format_activity_action_group_activity_update()
  • I've also removed the use of extract() in groups_post_update() and added 2 unit tests about this change.

@imath
18 months ago

#2 @imath
18 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12395:

Improve i18n of Groups activity updates action string

Dynamically generated activity action strings were introduced in BuddyPress 2.0 to ensure these strings are always up to date and multilingual-friendly (see #3856).

It appeared although the activity_update type enjoys this feature when activities are shared by users on their profiles, it was not the case for activity updates posted within Groups.

Thanks to this commit, BuddyPress is now taking it in charge by:

  • Registering a new group activity action to reference a specific formatting callback function for activities posted within Groups.
  • Making sure this new activity action type does not interfere with the one of regular activity updates in dropdown filters or into the Activity Administration screens.

BTW happy 4th WPTranslationDay to everyone :)

Fixes #8089

Note: See TracTickets for help on using tickets.