Jump to:

23372 Posts in 18171 Topics by 2865 members

General Questions

SilverStripe Forums » General Questions » Versioned objects do not work in ContentController

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

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

Page: 1
Go to End
Author Topic: 481 Views
  • walec51
    Avatar
    Community Member
    16 Posts

    Versioned objects do not work in ContentController Link to this post

    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

    481 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.