thanks for that advice - it's solved that error message but unfortunately it doesn't return any posts.
I've found there are 2 LatestPost functions, one in Forum.php and one in Post.php (both in forum/code).
Post.php:
function LatestPost() {
$filter = "";
if($this->ParentID != 0) {
$parents = $this->getDescendantIDList();
$parents[] = $this->ID;
$filter = "AND ParentID IN (" . implode(",", $parents) . ")";
}
$posts = DataObject::get("Post", "TopicID = $this->TopicID $filter",
"Created DESC", "", 1);
if($posts) return $posts->First();
}
Forum.php
/**
* Get the latest posting of the forum
*
* @return Post Returns the latest posting or nothing on no posts.
* @todo This is causing some errors, temporarily added is_numeric.
*/
function LatestPost() {
if(is_numeric($this->ID)) {
$posts = DataObject::get("Post", "ForumID = $this->ID",
"Created DESC", "", 1);
if($posts)
return $posts->First();
}
}
As you can see, they are similar but different.
And now I have 2 LatestPosts functions, one also in Forum.php and one in mysite/code/page.php as per the code posted in previous messages
So it compiles and runs, but doesn't actually produce any code in the resulting html. HELP!