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

Manifest Builder Bug


Reply

3 Posts   1670 Views

Avatar
Anonymous user

24 December 2007 at 9:59am 2 Posts

Modified mysite/code/Page.php with following code:

function getCMSFields() {

$rhs_sidebar_content = new TextAreaField('rhs_sidebar_content', 'RHS Sidebar Content');
$rhs_sidebar_flag = new CheckboxField('rhs_sidebar_flag', 'Show RHS Sidebar');
$lhs_sidebar_content = new TextAreaField('lhs_sidebar_content', 'LHS Sidebar Content');
$lhs_sidebar_flag = new CheckboxField('lhs_sidebar_flag', 'Show LHS Sidebar');

$fields = parent::getCMSFields();

$fields->addFieldToTab('Root.Content.Main', $rhs_sidebar_content, 'Content');
$fields->addFieldToTab('Root.Content.Main', $rhs_sidebar_flag, 'Content');
$fields->addFieldToTab('Root.Content.Main', $lhs_sidebar_content, 'Content');
$fields->addFieldToTab('Root.Content.Main', $lhs_sidebar_flag, 'Content');
   
return $fields;
}

Get error in admin of:- Fatal error: Class 'TextAreaField' not found in C:\wamp\www\ss\mysite\code\Page.php on line 15

Fault is intermittent but occurs mainly when clicking from "Site Content" to any page on the LHS menu

Fault can be worked around by adding line:

include_once('forms/TextAreaField.php');

at top of function

Suggests that manifest builder intermittently fails to pick up TextAreaField.php

Avatar
Tim

24 December 2007 at 10:38am Core Development Team, 201 Posts

Logged this @
http://open.silverstripe.com/ticket/2057#preview

Avatar
Ingo

24 December 2007 at 2:02pm Forum Moderator, 801 Posts

some info:
- a silverstripe PHP-class should always be contained in a file with the same name (e.g. "class TextareaField" should be contained in TextareaField.php) - this is how the manifestbuilder magically detects the required includes
- PHP-classnames are case-sensitive
- filenames might be case-sensitive depending on the operating system

for your specific problem: the class is actually called "TextareaField" with a lowercase "area" :)
i've closed the bug as "invalid" - cheers for your bugreport!