Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5597 closed defect (bug) (duplicate)

BP_Core_User::get_last_activity() returns incorrect result from cache

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

BP_Core_User::get_last_activity() returns either:

  • A multidimensional array keyed by user ID (for many users, or non-cached checks)
  • An array for one user with no user ID key (for cached checks)

It causes problems with BP_Core_User::update_last_activity() because $activity is not always keyed the same, and has hardcoded checks for:

  • 'id' => $activity[ $user_id ]['activity_id']
  • $activity[ $user_id ]['date_recorded'] = $time;

Resulting in the following debug notice and failed query:

Notice: Undefined offset: 1 in /wp-content/plugins/buddypress/bp-core/bp-core-classes.php on line 1399

Attachments (1)

5597.patch (908 bytes) - added by johnjamesjacoby 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @johnjamesjacoby
10 years ago

In 8326:

Add unit test for comparing subsequent calls to BP_Core_User::get_last_activity() to compare cached results to uncached results. See #5597, to test logic introduced in r8047.

#2 @johnjamesjacoby
10 years ago

  • Milestone 2.0.1 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Shucks... duplicate of #5590.

#3 @johnjamesjacoby
10 years ago

  • Keywords 2nd-opinion removed

#4 @johnjamesjacoby
10 years ago

In 8327:

Add unit test for comparing subsequent calls to BP_Core_User::get_last_activity() to compare cached results to uncached results. See #5590, #5597, to test logic introduced in r8047. (2.0 branch)

Note: See TracTickets for help on using tickets.