Jump to:

3372 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » News Section page type cannot load error

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

Page: 1
Go to End
Author Topic: 902 Views
  • jseth
    Avatar
    Community Member
    98 Posts

    News Section page type cannot load error Link to this post

    Using the documentation in tutorial 2, I created a news section page type and holder. Worked great (in ss ver 2.3.7). Now that I've created a new site using 2.4.0 (upgrade would not work for numerous reasons, I'm sure), I have the site back and working except for the news section page types. The holder works fine, and I can open it and create a new one in the CMS, but if I click on one of the news pages, I get the red "error loading page". I also cannot create a new news page type. I am not a dangerously sharp object when it comes to figuring out why things aren't working - could anyone provide a hint? I would suppose that the code requirements may have changed from 2.3.7 to 2.4.0, but I don't know what it would be. Thanks in advance. Here is my code:

    <?php
    /**
    * Defines the NewsEventsPage page type
    */
    class NewsEventsPage extends Page {
    static $db = array(
    'Date' => 'Date',
    'Author' => 'Text',
    'NewsFooter' => 'Text'
    );
    static $has_one = array(
    );

    function getCMSFields() {
    $fields = parent::getCMSFields();

    $fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
    $fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
    $fields->addFieldToTab('Root.Content.Main', new TextField('NewsFooter'),'Content');
       
    return $fields;
    }

    }

    class NewsEventsPage_Controller extends Page_Controller {

    }

    ?>

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: News Section page type cannot load error Link to this post

    CalendarDateField has been removed from 2.4 - You should use DateField instead.

  • jseth
    Avatar
    Community Member
    98 Posts

    Re: News Section page type cannot load error Link to this post

    Thanks for the info. As it happened, I just reinstalled 2.3.7 and will stick with that version until I have the luxury of playing with 2.4.0. Seems like there are a lot of "issues".

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