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

buddypress-trac noreply at wordpress.org
Fri Jun 7 01:31:28 UTC 2013

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

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


 In [changeset:"7179"]:
 #!CommitTicketReference repository="" revision="7179"
 Improvements to refreshing of total_group_count on group membership events

 When group membership status is changed for a user, that user's
 total_group_count meta must be updated. This changeset introduces a number
 improvements to the way this updating is done:

 - Update using an actual queried group count, rather than incrementing.
   ensures that even if the count is off (due to a bug in BP or some other
   plugin), it will be corrected the next time a membership event is
 - Move the total_group_count refreshing further down the stack.
 Previously, the
   updating was happening at various depths: sometimes in the
   bp-groups-functions.php functions, sometimes in the database methods,
   sometimes not at all. By moving the updates so that they directly follow
   database queries, we reduce redundancy and ensure that the group count
   updated in all cases

 This changeset also introduces integration tests for the relevant groups_*
 membership functions and total_group_count.

 Fixes #5018

 Props mukkundthanki, r-a-y for early patches

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

More information about the buddypress-trac mailing list