Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Latest post calculation fix #41

Merged
merged 2 commits into from

2 participants

Márton Vincze Colby Klein
Márton Vincze

This proposal fixes #39 .

I know it is debatable that the last post is the last one edited not the last one created, but it since most forum engines went with the latter, it was confusing.

Also since the creation date for the post is also shown there, it hinted that there are no posts in the thread after the date shown, which is not always true.

The forum list also shows the post last created. It is reasonable that the 2 places should work the same way.

Colby Klein shakesoda merged commit 9003db0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 forum/code/model/Post.php
6 forum/code/model/Post.php
View
@@ -62,13 +62,13 @@ function onBeforeDelete() {
/**
* After saving this post, update the {@link ForumThread} with information
- * that this is now the most recent post
+ * that the most recent post could have changed.
*/
function onAfterWrite() {
parent::onAfterWrite();
- // Tell the thread this is the most recently added or edited.
- if ($this->ThreadID) $this->Thread()->updateLastPost($this);
+ // Force thread to recalculate it's most recent.
+ if ($this->ThreadID) $this->Thread()->updateLastPost();
}
function onAfterDelete() {
Something went wrong with that request. Please try again.