Skip to:
Content

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#543 closed defect (bug) (fixed)

New Post not added to activity (site wide or user)

Reported by: westpointer Owned by:
Milestone: Priority: major
Severity: Version:
Component: Keywords:
Cc:

Description

When a new post is published, site wide activity and user activity are not updated.

I've tracked this down to bp-blogs.php, line 443

if ( $recorded_post->date_created >= strtotime( "-30 minutes" ) ) {

I tested changing the time to -3000 and the post was added to the activity tables. I think the problem is that $recorded_post->date_created is based on my time zone, EST. But strtotime( "-30 minutes" ) is using mountain time (the wpmu default time zone). Therefor, my new post always evaluates as being more than 30 minutes old.

Change History (5)

comment:1 westpointer5 years ago

No, not mountain time, it must be evaluating using GMT.

comment:2 westpointer5 years ago

OK, this is a confirmed bug. The post_date reflects the time zone set for the blog which is mountain time. I'm in the eastern time zone so my post was seen by this line of code as 2 hours old as soon as I added the post. We need to off-set for the time zone.

REPLACE:

if ( $recorded_post->date_created >= strtotime( "-30 minutes" ) )

WITH

'
if ( $recorded_post->date_created >= (current_time('timestamp') - 30) )

that will fix the problem!

comment:3 apeatling5 years ago

Your code would subtract 30 seconds.

There is actually a global problem with time zone calculations. I'm going to change this to 24 hours, which will patch it for now. Time zones need to be addressed on a broader scale.

comment:4 apeatling5 years ago

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

(In [1186]) Fixes #543

comment:5 westpointer5 years ago

LOL .. sorry, yes that would be 30 seconds! But, I found that the change does do the job.

Note: See TracTickets for help on using tickets.