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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Versioned objects do not work in ContentController

Go to End



Community Member, 16 Posts

15 May 2010 at 5:25am

Did any one notice this ?

If you make a method like this:

public function viewermakesoffer() {

$page = new Page();
$page->Title = "xxxxxx";
$page->MenuTitle = "xxxxxx";
$page->URLSegment = "xxxxxxx";
$page->Status = "Published";
$page->publish("Stage", "Live");

In a ContentController and execute it by calling the right url the versioning mechanizm will go bizzare and create a nullafied SiteTree object in the database.

But the method will work ok if you put it in plain Controller.

Filed it in: