Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Problems with getting the latest forum post


Go to End


5 Posts   1318 Views

Avatar
Nivanka

Community Member, 400 Posts

10 September 2008 at 8:04pm

Edited: 10/09/2008 8:05pm

I tried to get the latest forum post with this code.

return DataObject::get_one('Post', '', 'Created DESC');

this works fine, but when I delete the latest forum post from the forum the site just doesnt return anything to the screen (whole screen is white).

To get the site live again I have to make a forum post.

can anyone help me with this?

Avatar
grilldan

Community Member, 135 Posts

10 September 2008 at 8:33pm

Could it be that you only have 1 post, and you delete that post, then there is nothing to get. Does it work for you when you have more then 1 post (try it with at least 2 posts)?

Avatar
Nivanka

Community Member, 400 Posts

10 September 2008 at 8:37pm

No that is not the problem, It doesnt get the older posts.

Avatar
grilldan

Community Member, 135 Posts

10 September 2008 at 8:42pm

Edited: 10/09/2008 8:48pm

Avatar
Nivanka

Community Member, 400 Posts

11 September 2008 at 1:46am

I checked with that code too.
But the result is the same.

I am using this on a page which I created as the page is in another module.