[buddypress-trac] [BuddyPress] #4393: Deleting favorited activity does not update user favorite counts

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Aug 10 03:05:24 UTC 2012


#4393: Deleting favorited activity does not update user favorite counts
------------------------------------+---------------------
 Reporter:  kumo99                  |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  1.7
Component:  Activity                |     Version:  1.6-rc
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+---------------------
Changes (by boonebgorges):

 * keywords:  needs-patch => has-patch dev-feedback


Comment:

 Thanks, rachelbaker!

 I fleshed out the patch a bit, to handle the deleting, as well as user
 favorite removal.

 I didn't add in the activity_exists check. We could probably abstract it
 into a separate function, and call it both on favorite creation and
 favorite removal. It adds a bit of overhead, but will be good for data
 integrity. bp_activity_get() takes an 'in' parameter, so we should be able
 to do it with just a single query - and if we want an even leaner DB
 method (just to grab the ids, instead of a join or whatever crummy thing
 the activity query does :) ) we can just add it, as r-a-y suggests.

 I also rearranged some of the strange error logic of the remove_favorite
 function, which didn't seem to do anything useful.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4393#comment:10>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list