Hello,
I've made some changes to the CMS fields and the database structure of a template of mine. It works just fine on my machine, but when I upload it to my test server, the entire site crashes. I can't go to the admin login, I can't reach dev/build or anything, it just gives me:
"Website Error
There has been an error
The website server has not been able to respond to your request."
for every page I try to access. When I replace the php file in mysite/code with the old one, everything starts working again. What have I done wrong? This is the code that I've modified:
class StartPage extends SiteTree {
public static $db = array(
'Puff1titel' => 'Varchar',
'Puff1kolumn1titel' => 'Varchar',
'Puff1kolumn1text' => 'Text',
'Puff1kolumn2titel' => 'Varchar',
'Puff1kolumn2text' => 'Text',
'Puff2titel' => 'Varchar',
'Puff2kolumntitel' => 'Varchar',
'Puff2text' => 'Text'
);
public static $has_one = array(
"Puff1kolumn1link" => "SiteTree",
"Puff1kolumn2link" => "SiteTree"
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new TextField('Puff1titel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Puff1kolumn1titel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextareaField('Puff1kolumn1text'), 'Content');
$fields->addFieldToTab("Root.Content.Main", new TreeDropdownField("Puff1kolumn1linkID", "Puff1kolumn1link", "SiteTree"));
$fields->addFieldToTab('Root.Content.Main', new TextField('Puff1kolumn2titel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextareaField('Puff1kolumn2text'), 'Content');
$fields->addFieldToTab("Root.Content.Main", new TreeDropdownField("Puff1kolumn2linkID", "Puff1kolumn2link", "SiteTree"));
$fields->addFieldToTab('Root.Content.Main', new TextField('Puff2titel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Puff2kolumntitel'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextareaField('Puff2text'), 'Content');
$fields->removeFieldFromTab('Root.Content.Main', 'Content');
return $fields;
}
}