Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#7114 closed enhancement (fixed)

XProfile: Do not duplicate populate logic in BP_XProfile_Field

Reported by: r-a-y Owned by: r-a-y
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.4.0
Component: Extended Profile Keywords: has-patch commit
Cc:

Description (last modified by r-a-y)

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.

Attachments (1)

7114.01.patch (1.4 KB) - added by r-a-y 3 years ago.

Download all attachments as: .zip

Change History (5)

@r-a-y
3 years ago

#1 @r-a-y
3 years ago

  • Description modified (diff)
  • Summary changed from XProfile: Do not duplicate caching logic in BP_XProfile_Field to XProfile: Do not duplicate populate logic in BP_XProfile_Field

#2 @DJPaul
3 years ago

  • Milestone changed from Awaiting Review to 2.7

Looks good

#3 @DJPaul
3 years ago

  • Keywords commit added

#4 @r-a-y
3 years ago

  • Owner set to r-a-y
  • Resolution set to fixed
  • Status changed from new to closed

In 10948:

XProfile: Do not duplicate populate logic in the BP_XProfile_Field class.

Previously, the $wpdb->get_row() call was duplicated in both the
BP_XProfile_Field::populate() and BP_XProfile_Field::get_instance() DB
methods.

This commit merges the logic into the BP_XProfile_Field::populate()
method and passes existing unit tests.

Fixes #7114.

Note: See TracTickets for help on using tickets.