[buddypress-trac] [BuddyPress] #5018: Update user meta field 'total_group_count' when user joins group

buddypress-trac noreply at wordpress.org
Sat May 25 18:27:28 UTC 2013

#5018: Update user meta field 'total_group_count' when user joins group
 Reporter:  mukkundthanki  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  1.8
Component:  Groups         |     Version:  1.7
 Severity:  normal         |  Resolution:
 Keywords:                 |
Changes (by boonebgorges):

 * milestone:  Awaiting Review => 1.8


 Very odd that we're not upgrading a user's total_group_count when they
 join. (We do when they accept an invitation or when the request is
 approved.) I guess it's never come up, because we don't really appear to
 use this value anywhere in BP, at least not where I can see.

 So, yes, it appears that we should be doing so.

 Also, everywhere where we change total_group_count, we do it by
 incrementing or decrementing the current count. This can cause problems
 like the one you describe. Instead, I think it makes more sense to
 actually tabulate the group count at that moment, by querying the group
 member table. It definitely takes more resources to do this, but
 joining/leaving groups is a pretty rare occurrence.

 Moving to 1.8 for examination. If you have a patch for either of these two
 problems, please feel free to post it.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5018#comment:1>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list