[buddypress-trac] [BuddyPress Trac] #3794: Deleted activity items remain favourited

buddypress-trac noreply at wordpress.org
Sun Sep 28 13:52:15 UTC 2014

#3794: Deleted activity items remain favourited
 Reporter:  ewebber       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  2.2
Component:  Activity      |     Version:  1.5.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |

Comment (by imath):

 Replying to [comment:16 DJPaul]:
 > Replying to [comment:14 imath]:
 > > Replying to [comment:13 DJPaul]:
 > >
 > > > Why do we want to change that away from storing the total count in
 user meta? User meta seems the appropriate place for this (just like how
 we already store an activity's total favourite count in its
 `favorite_count` activity meta).
 > >

 > For simple use cases like displaying a number of how many times an
 activity has been favourited, a meta item will be much quicker (I'm 99%
 sure this is why bbPress has functions like `bbp_get_topic_reply_count`
 which use post meta).

 Actually the '''activity meta''' is still there, i haven't changed this
 behavior. So you can use it to know how many times an activity was

 > > I have no objection to store a count in user meta, it's just the count
 is already there by requesting activities having the type
 'activity_favorite' for the user id.
 I've changed my mind, '''i have an objection''' :) I think using a user
 meta to store the count will complexity the thing. If i have a user meta
 set to 3, and any random activity is deleted, then we would need to do
 another query to look for each user who favorited the activity and update
 the count for each user, else this ticket is not solved.

 About using another table, i've changed my mind after other comments and
 the fact that at that time, it could be interested to have activities
 showing like 'imath favorited this activity'. If you apply the patch and
 go into the Activity administration screen, you'll see that the admin is
 able to see who favorited what by selecting the 'activity_favorite' type
 in the drop down.

 Just to come back on :
 > If I wanted to find out the user IDs (for example) of everyone who has
 favourited a specific activity item, how would I do that? To clarify, I am
 not necessarily saying we should build new API functions to do this, I am
 just wondering how it would be possible to do this.

 Today it's very complex to do this. Because you need to get all usermeta,
 check if the activity ID is in the array of activities of each user meta..
 With that patch, i think it's easier ;)

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3794#comment:17>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list