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.

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


1145 Views

Avatar
walec51

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->write();
$page->publish("Stage", "Live");
return;
}

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: http://open.silverstripe.org/ticket/5596