[buddypress-trac] [BuddyPress] #4331: Author's Name in Activity Action does not change upon changing the name from settings
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Fri Jul 6 13:58:58 UTC 2012
#4331: Author's Name in Activity Action does not change upon changing the name
from settings
--------------------------+----------------------
Reporter: gagan0123 | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Activity | Version: 1.5.6
Severity: normal | Resolution: wontfix
Keywords: |
--------------------------+----------------------
Changes (by boonebgorges):
* status: new => closed
* resolution: => wontfix
* milestone: Awaiting Review =>
Comment:
The reason the activity action doesn't change is because activity actions
are stored as strings in the database at the time of creation. They are
not generated dynamically on every page load - this would require a large
amount of overhead. See, eg, #3063.
There are a few ways to work around this restriction:
(a) Put a filter on `'bp_get_activity_action_pre_meta'` or
`'bp_get_activity_action'` and do your own dynamic action generation on
the fly. (It may be more efficient to hook to `'bp_has_activities'` and
loop through all of `$activities_template->activites` at once.)
(b) Hook to the user displayname change action (I'm sure there are several
places to hook) with a function that looks up all activity with the
relevant user_id, and rebuilds the activity action accordingly (even just
a str_replace() would probably work).
Doing either of these in BP itself would not scale very well for medium-
to-large sites (at least not without some major architectural changes),
but either would be perfectly appropriate for a plugin.
Going to close as wontfix for the moment. If you have a better idea about
how this might be done without adding huge amounts of overhead, please
share. Thanks!
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4331#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list