[buddypress-trac] [BuddyPress Trac] #7114: XProfile: Do not duplicate populate logic in BP_XProfile_Field (was: XProfile: Do not duplicate caching logic in BP_XProfile_Field)

buddypress-trac noreply at wordpress.org
Thu Jun 9 17:55:15 UTC 2016


#7114: XProfile: Do not duplicate populate logic in BP_XProfile_Field
----------------------------------+------------------------------
 Reporter:  r-a-y                 |       Owner:
     Type:  enhancement           |      Status:  new
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Component - XProfile  |     Version:  2.4.0
 Severity:  normal                |  Resolution:
 Keywords:  has-patch             |
----------------------------------+------------------------------
Description changed by r-a-y:

Old description:

> While debugging #7112, I saw some duplicate caching logic that we can
> remove.
>
> See attached patch.

New description:

 While debugging #7112, I saw some duplicate DB logic that we can remove.

 The $wpdb->get_row() call is duplicated in both
 `BP_XProfile_Field::populate()` and `BP_XProfile_Field::get_instance()` DB
 methods.

 Attached patch merges the logic into the `populate()` method and passes
 existing unit tests.

--

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


More information about the buddypress-trac mailing list