[buddypress-trac] [BuddyPress Trac] #5590: Undefined offset when updating the last_activity
buddypress-trac
noreply at wordpress.org
Wed Apr 30 17:22:23 UTC 2014
#5590: Undefined offset when updating the last_activity
----------------------------------------+---------------------------
Reporter: imath | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 2.1
Component: Core | Version: 2.0
Severity: normal | Resolution: fixed
Keywords: has-patch needs-unit-tests |
----------------------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"8332"]:
{{{
#!CommitTicketReference repository="" revision="8332"
Overhaul caching for user last_activity values
The last_activity methods in the BP_Core_User class were originally
designed
without persistent caching in mind. In r8047, some minimal caching support
was
introduced, but it was tacked on and incomplete. In particular, it
depended
on an inconsistent structure of return values from the last_activity
methods.
See #5128 for more background.
This changeset introduces a number of changes that make last_activity
methods
perform more consistently, as well as full support for object caching.
- BP_Core_User::get_last_activity() always returns a multidimensional
array
of last_activity arrays, keyed by user_id. This remains true even when
last_activity data is being fetched only for a single user.
- last_activity data is stored in the bp_last_activity cache bucket
without
the user-id-keyed wrapper.
- BP_Core_User::get_last_activity() now uses the same caching technique as
other BuddyPress and WordPress queries: detect which requested items are
not
yet in the cache, prime the cache for those items, and then fetch all
requested values directly from the cache to build a return value.
Fixes #5590
Props imath, johnjamesjacoby for initial patches
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5590#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list