[buddypress-trac] [BuddyPress] #4310: Members Profile Shows "active sometime ago"

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Wed Jul 11 13:46:40 UTC 2012


#4310: Members Profile Shows "active sometime ago"
-------------------------------------------+------------------------------
 Reporter:  frank13                        |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Awaiting Review
Component:  Core                           |     Version:  1.5.6
 Severity:  normal                         |  Resolution:
 Keywords:  needs-patch reporter-feedback  |
-------------------------------------------+------------------------------

Comment (by boonebgorges):

 > Both attempts failed to show my users active since a real time rather
 than "active sometime ago"

 That may be. But this assumes that `bp_core_current_time()` is root of
 your original problem, which I've hypothesized it's not (because the times
 are relative). In any case, the only real way to see whether the filters
 are doing what they're intended to do is to dump the value of
 `bp_core_current_time()` to your screen; if it's showing the times you've
 entered in your filters, then the filters are working.

 I remain convinced that we haven't really narrowed in on the real culprit,
 and more debugging is needed to find the point where the divergence in
 timestamps is taking place. Given that we know that the last_activity
 values in the DB are correct (I'm not sure that we do know this, as you
 posted these https://buddypress.trac.wordpress.org/ticket/4310#comment:10
 without comment - but I'm assuming they're correct), it's a pretty short
 chain from there to the "since" text. The trace looks something like this
 (in the member directory - it's slightly different elsewhere):

 1) `BP_Core_User::get_users()` (the query joins against the usermeta table
 to get the `last_activity` value)
 2) `bp_get_member_last_active()` (the template function that pulls the
 information out of the query object)
 3) `bp_core_get_last_activity()` (called by `bp_get_member_last_active()`
 to format the last active string)
 4) `bp_core_time_since()` (called by `bp_core_get_last_activity()` to
 convert the last active date into a 'since' string)

 (I've left out a couple of finer points, but these are the ones where,
 IMO, there is the possibility of breakage.)

 At each of these points, drop debug statements to make sure that the
 timestamps are matching up properly. In the case of
 `bp_core_time_since()`, you may have to do a line-by-line debug, to see if
 the problem is being introduced with the auto-detection of `$newer_time`.
 In any case, the issue arises somewhere along this stack.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4310#comment:19>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list