[buddypress-trac] [BuddyPress Trac] #6658: Deleting xProfile field leaves meta behind

buddypress-trac noreply at wordpress.org
Mon Feb 5 16:39:59 UTC 2018


#6658: Deleting xProfile field leaves meta behind
------------------------------------------+--------------------------------
 Reporter:  garrett-eclipse               |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting
Component:  Extended Profile              |  Contributions
 Severity:  normal                        |     Version:  2.3.3
 Keywords:  needs-patch needs-unit-tests  |  Resolution:
------------------------------------------+--------------------------------

Comment (by boonebgorges):

 Thanks for working on this, @Offereins!

 > b) using bp_xprofile_delete_meta() which fires subsequent hooks in
 delete_metadata

 I'd suggest this. `bp_xprofile_delete_meta( $field_id, 'field' )` (no
 `$meta_key`) calls `delete_metadata()`, which assembles a single `DELETE`
 query for all metadata entries and fires all the hooks appropriately. This
 appears to be what we do with groups, so it'll be consistent.

 > right in BP_XProfile_Field::delete()

 I guess I'd suggest this, since it's what we do with groups and activity.
 If there's good justification for doing it in a hook (like, making it
 unhookable), let's handle it separately, and change all object types over
 at once.

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


More information about the buddypress-trac mailing list