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.

Data Model Questions /

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

News Section page type cannot load error


Go to End


3 Posts   1654 Views

Avatar
jseth

Community Member, 98 Posts

12 May 2010 at 1:38am

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 {

}

?>

Avatar
Willr

Forum Moderator, 5523 Posts

12 May 2010 at 8:35pm

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

Avatar
jseth

Community Member, 98 Posts

12 May 2010 at 11:35pm

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