the "recent posts" page has been bothering me and users of my sites for quite a while. it's very blog-specific -- it sorts everything by "last post". however, on sites where content is mostly in pages that are edited, instead of commented on, this is the wrong thing to display. instead, you want to see "last updated" where "updated" can be either the node is edited, or a comment is added.
the attached patch solves this problem by using GREATEST(n.changed, l.last_comment_timestamp) (just like we do in node.module), and sorting by/displaying that. you still get all the nice behavior in the "replies" column -- i didn't touch any of that. i just renamed the final column, and changed the value that's in there.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | tracker_HEAD_last_updated-no_double_sanitize.patch | 3.12 KB | dww |
| #3 | tracker_4.7_last_updated.patch | 3.13 KB | dww |
| #2 | tracker_HEAD_last_updated_changelog.patch | 3.66 KB | dww |
| tracker_HEAD_last_updated.patch | 3.12 KB | dww |
Comments
Comment #1
webchick+1 to this change. Tested, works as expected. RTBC.
Comment #2
dwwbtw, i'm not being lazy -- if this were worthy, my patch would have included a diff against CHANGELOG, too. i just don't think this qualifies as needing a CHANGELOG entry. however, if you want it, here's a patch that includes a draft of one. ;) i still think the orig patch is better...
Comment #3
dwwi'm 98% sure no one will consider this a bug for 4.7, so i highly doubt the patch attached to *this* follow-up will get committed to core. however, if anyone else wants this behavior in a 4.7 site (like me), the attached patch applies cleanly. provided for convinience -- use at your own risk. ;)
Comment #4
dwwto review, http://drupal.org/files/issues/tracker_HEAD_last_updated.patch from the initial issue is still RTBC, with one possible exception. i just noticed the t() conversion (which is the reason the same patch doesn't apply cleanly in HEAD vs. 4.7) is perhaps incorrect in this case. it's now doing a
check_plain()via@, however, this is just a time interval, printed viaformat_interval(), which already does its own output sanitizing. seems like maybe!would be more appropriate? attached patch uses!, in case that's what folks want. using@ends up sanitizing the output twice, given my understanding of the newt()behavior.Comment #5
dwwwhoops, this is duplicate with http://drupal.org/node/44276 (which is a bug report against 4.6). i also noticed there's no need for the
AS last_postpart of the SQL in these patches, so i'll just post the latest patches for 4.7 and HEAD to #44276.