[buddypress-trac] [BuddyPress Trac] #3856: Saving activity update action as an array in db
buddypress-trac
noreply at wordpress.org
Sat Mar 1 18:22:04 UTC 2014
#3856: Saving activity update action as an array in db
-----------------------------------+------------------
Reporter: modemlooper | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.0
Component: Activity | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion |
-----------------------------------+------------------
Comment (by boonebgorges):
> Something happened 3 minutes ago :)
Ah yes. So, what I meant to do (but I see now that I didn't fully
implement) was this: When an activity item is created, store the generated
action test as a string in the 'action' field. (Like we currently do.) On
output, try to generate the action string dynamically. But if this fails,
use the literal action string as a fallback. I forgot to do this last part
:) I think that's better than trying to remove stuff from the activity
stream, at least for now. (It may or may not be a good idea not to show
activity items from components that have been deactivated, but I don't
think we should make the decision based on technical limitations of this
patch.)
> I thought it wasn't necessary to create an activity_meta in case the
action_data was an empty array. So i've added a check
Excellent. I meant to do this myself.
> Because $action is always set, if not passed in arguments to
bp_activity_add() then it defaults to '' so the
bp_activity_generate_action_string( $activity ) part is never played and
as a result activity_update and joined_group has a blank action in
activity table.
For backward compatibility. On the day that 2.0 launches, it's likely that
most plugins (like, say, BuddyPress Docs) will not have updated to the new
callback method. We still want to support recording a literal 'action'
string in the database. The logic in the patch might be incorrect (I need
to write some unit tests ;) ) but we do need to do something like this. I
think your `empty()` modification might fix it.
> So plugin developer will begin to use bp_activity_set_action() to
register their activities, may be we can also improve the templates
(activity/index, members/single/activity & groups/single/activity) to make
this use avoids them to hook the "filter" actions.
I'm not sure I understand this. Can you give an example?
> And why not carry on by only displaying activities for the active
components.
This is an interesting idea, but as I suggest above, I think it's a
separate issue and we should discuss in a different ticket.
Thanks very much for the feedback! I think this will make a huge
difference for international and multi-lingual communities.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3856#comment:17>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list