Site Notes

Update on RTH Edit Comment Bug

By Ryan McGreal
Published April 22, 2010

A few RTH readers have reported an occasional issue in which they try to edit a recently-posted comment but the page says the window to edit comments has already closed.

The bug might have something to do with the fact that comments have been showing a posted datestamp an hour before they were actually posted (What? The internet spans more than one time zone??). However, the bug occurs only sporadically and I haven't yet been able to replicate it.

In the meantime, I've bumped the edit/delete window for new comments from 15 minutes to 90 minutes. I hope this will ameliorate the effects of the bug while I continue to try and chase it down.

If you have any suggestions, please feel free to leave a comment on this blog entry or the bug report on Github.

Ryan McGreal, the editor of Raise the Hammer, lives in Hamilton with his family and works as a programmer, writer and consultant. Ryan volunteers with Hamilton Light Rail, a citizen group dedicated to bringing light rail transit to Hamilton. Ryan wrote a city affairs column in Hamilton Magazine, and several of his articles have been published in the Hamilton Spectator. His articles have also been published in The Walrus, HuffPost and Behind the Numbers. He maintains a personal website, has been known to share passing thoughts on Twitter and Facebook, and posts the occasional cat photo on Instagram.


View Comments: Nested | Flat

Read Comments

[ - ]

By crhayes (registered) - website | Posted April 23, 2010 at 00:43:36

There's an easy way to fix this... WordPress ;)

All joking aside, I have seen others with similar issues (on stackoverflow for example) where subtracting datetimes can cause buggy result records.

What if you tried using TIMESTAMPDIFF?

select *, now() as now, TIMESTAMPDIFF(SECOND, date_posted, now()) as timediff from comments where comment_id = :comment_id

You can use it with a SECOND argument.

P.S. Why don't you use WordPress? I'm guessing it's because developing this is more enjoyable (as a hobby?)... that's how it is for me...

P.P.S. This site is blazingly fast, I'm sure that's a factor ;)

Comment edited by crhayes on 2010-04-22 23:59:37

Permalink | Context

[ - ]

By schmadrian (registered) | Posted April 23, 2010 at 10:23:36

Anyone who uses the word 'ameliorate' instantly goes on my Christmas list.

: )

(What size socks do you wear, Ryan...?)

Permalink | Context

[ - ]

By crhayes (registered) - website | Posted April 23, 2010 at 15:39:32


I love programming in PHP, although I don't have any experience in Python. To each their own :)

Permalink | Context

[ - ]

By crhayes (registered) - website | Posted April 23, 2010 at 18:45:19

I have done some C and Java as well, but PHP is the first programming language I learned (when I was around 15) and so it has always been my favourite (and I feel comfortable with it).

Some of the features you mentioned have been included in PHP 5 (namespacing, method chaining)... PHP 5 is much more OO.

I don't have experience with Ruby but I know it's really powerful. It used to be difficult to find a Ruby host but I think it has gotten better in recent years.

Comment edited by crhayes on 2010-04-23 17:47:39

Permalink | Context

[ - ]

By PyGuy (anonymous) | Posted April 27, 2010 at 11:06:09

^If you haven't coded in a language like Python (or Ruby or Lisp or Scheme or...) and you think PHP is pretty good, do yourself the favour and expand your mind with a modern, powerful, DESIGNED language. You'll be a better coder for it and never look at PHP the same again.

Permalink | Context

View Comments: Nested | Flat

Post a Comment

You must be logged in to comment.

Events Calendar

There are no upcoming events right now.
Why not post one?

Recent Articles

Article Archives

Blog Archives

Site Tools