Skip to:
Content

Opened 3 years ago

Closed 3 years ago

#6100 closed defect (bug) (fixed)

Incorrect XProfile data cache group

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.0
Component: Extended Profile Keywords: has-patch
Cc:

Description

In the XProfile component, field data is currently grouped by user ID like: bp_xprofile_data_1

This has the unintended consequence of XProfile field data cannot be fully purged for all users without first analyzing which groups exist and unsetting them. This isn't necessarily wrong (because we are free to key and group things however we see fit) but it is the only cache group in all of WordPress & BuddyPress that currently works like this, and we may need to use dynamic cache groups in a more creative way in the future.

Attachments (1)

6100.patch (10.4 KB) - added by johnjamesjacoby 3 years ago.

Download all attachments as: .zip

Change History (3)

#1 @johnjamesjacoby
3 years ago

In 6100.patch I'm switching the cache group over to bp_xprofile_data and setting it as a global group, then keying by $user_id:$field_id instead of just $field_id. I'm also taking advantage of BP_Component enhancements introduced in #5733. Patch also includes updated unit tests, props r-a-y.

#2 @johnjamesjacoby
3 years ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to closed

In 9336:

XProfile data cache group updates:

  • Switches from dynamic cache group to unique key for $user_id:$field_id.
  • Introduces bp_xprofile_get_non_cached_field_ids() as a helper, based on bp_get_non_cached_field_ids().
  • Registers bp_xprofile and bp_xprofile_data as global cache groups.
  • Updates unit tests to pass with new cache keys.

Props r-a-y. Fixes #6100. See #5733.

Note: See TracTickets for help on using tickets.