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

Upgraded to 2.4.5 my EventsPage has "error loading"


Go to End


820 Views

Avatar
pinkp

Community Member, 182 Posts

2 April 2011 at 5:38am

After upgrading to SS 2.4.5 my EventsPage will not load. The browser is not throwing up any specific errors simply"

"The page at www.mysite.co.uk says:"

that's it. I am a little rusty at the moment after an 8 month break from SS. Could someone please point me in the right direction for debugging.
The page is as follows:

EventPage.php

<?php
class EventPage extends Page
{
	static $has_many = array (
		'Events' => 'Event'
	);
	
	static $has_one = array(
		'Flyer' => 'Image'

   );
	
	public function getCMSFields()
	{
		$f = parent::getCMSFields();
		$manager = new DataObjectManager(
			$this, // Controller
			'Events', // Source name
			'Event', // Source class
			array('Date' => 'Date', 'Title' => 'Title', 'Link' => 'Link', 'Location' => 'Location & Time', 'Description' => 'Description'), // Headings
			'getCMSFields_forPopup' // Detail fields function or FieldSet
			// Filter clause
			// Sort clause
			// Join clause
		);

		
		$f->addFieldToTab("Root.Content.Events", $manager);
		
		$f->addFieldToTab("Root.Content.Images", new ImageField('Flyer','Flyer'));
	
		return $f;
	}

}
class EventPage_Controller extends Page_Controller
{
}
?>

Event.php

<?php
class Event extends DataObject
{
	static $db = array (
		'Date' => 'Date',
		'Title' => 'Text',
		'Link' => 'Text',
		'Location' => 'Text',
		'Description' => 'Text'
	);
	
	static $has_one = array (
		'EventPage' => 'EventPage'
	);
	
	
	public function getCMSFields_forPopup()
	{
		return new FieldSet(
			new CalendarDateField('Date'),
			new TextField('Title'),
			new TextField('Link'),
			new TextField('Location'),
			new TextareaField('Description')
			);
	}
}
?>

many thanks