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.

Archive

Our old forums are still available as a read-only archive.

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

Error 256


Reply

3 Posts   1438 Views

Avatar
nascent

23 October 2007 at 10:43pm (Last edited: 23 October 2007 11:11pm), 6 Posts

Hi guys,
I'm working through Tutorial 2 and have created /tutorial/code/ArticlePage.php with the following code:

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

static $has_one = array(
);

static $allowed_children = array('ArticlePage');

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

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

class ArticleHolder_Controller extends Page_Controller {

}

?>

I have run /db/build/?flush=1 and cleared the cache.

The page type now appears in my page type list, however I cannot create a page using it (nothing happens when I click the 'go' button) and I get the following error when trying to go to any other page in the CMS:

ERROR: Error 256 Bad Class to Singleton() - ArticleHolder

Any suggestions as to what I might be doing wrong?

cheers,
nascent

Avatar
nascent

23 October 2007 at 11:13pm 6 Posts

Here's the full error message.

Avatar
nascent

23 October 2007 at 11:51pm 6 Posts

Duh.
There are two pages to create:
ArticlePage.php AND ArticleHolder.php

All fixed now
n.