Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » Versioning new page types

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: 134 Views
  • Jeremiah
    Avatar
    Community Member
    4 Posts

    Versioning new page types Link to this post

    Hello all,

    We are using SS 3.0 and I'm having some problems with versioning on new page types.

    When I create a new page that extends "Page" and add new fields to it they don't seem to version correctly in the CMS. Using just the default "Page" type seems to version okay. Say I create a new pagetype of TestPage that extends page.

    class TestPage extends Page {

       public static $db = array(
          'Test' => 'HTMLText',
       );

       function getCMSFields() {
          $fields = parent::getCMSFields();
          $fields->removeFieldFromTab("Root.Main","Content");
          $fields->addFieldToTab('Root.Main', new HTMLEditorField('Test', 'Test'));
       return $fields;
    }

    I then create a new page in the CMS with a page type of TestPage, add some content to the "test" area, and the save & publish everything is all dandy. Now I Modify the content again and this time hit save draft, the draft is saved and all is good. Next if I hit
    cancel draft changes, it prompts me if i'm sure, I say yes, and it says it was reverted, but if you look at the content it infact was not reverted...

    The same holds true for the versioning. If I look at the history on my new test page all of the versions show they are the same.

    Am I missing something obvious here? Do I need to add something to the new page type to version the new content area correctly? What is also strange is that if I look at the content in the database in the versions table it seems to show the correct values for each version, but not when looking through the cms.

    This is actually a pretty serious problem right now because we have live sites that wont version.

  • Jeremiah
    Avatar
    Community Member
    4 Posts

    Re: Versioning new page types Link to this post

    Anyone? I would really appreciate any help/direction I can get. This seems like a problem with the CMS or a problem with my configuration of the new page type.

    134 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.