[buddypress-trac] [BuddyPress Trac] #7523: Messages are not deleted from DB, when user is deleted

buddypress-trac noreply at wordpress.org
Mon May 15 02:00:45 UTC 2017


#7523: Messages are not deleted from DB, when user is deleted
--------------------------+-----------------------
 Reporter:  slaFFik       |       Owner:  r-a-y
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  2.9
Component:  Messages      |     Version:  1.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------
Changes (by r-a-y):

 * keywords:  2nd-opinion => has-patch
 * owner:   => r-a-y
 * version:   => 1.0
 * status:  new => assigned
 * milestone:  Awaiting Review => 2.9


Comment:

 Nice catch.  Surprised we never added a cleanup routine for the Messages
 component!

 Your `$force` parameter sounds like a good way to fix this.  The other
 problem is querying for all message threads for the deleted user.

 `01.patch` does the following:
 - Adds `$force` parameter to `BP_Message_Thread::delete()` to make message
 thread deletion easier.
 - Adds some new parameters to
 `BP_Message_Threads::get_all_current_threads_for_user()` to query for
 message threads.  In particular, `$deleted` is the most important one.
 `$fields` and `$count_total` are enhancements to only query for the
 message thread IDs and to omit the total count.
 - Refactors `BP_Message_Threads::get_all_current_threads_for_user()` to
 work better with multiple `WHERE` conditions.
 - Includes a unit test.

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


More information about the buddypress-trac mailing list