When Accessing Admin I get the following error when in DEV mode:
[Warning] Missing argument 2 for LabelField::__construct(), called in /home/m8lighti/public_html/mysite/code/PageInt.php on line 22 and defined
10 class LabelField extends DatalessField {
11
12 /**
13 * @param string $name
14 * @param string $title
15 * @param string $className (Deprecated: use addExtraClass())
16 * @param bool $allowHTML (Deprecated: use setAllowHTML())
17 * @param Form $form
18 */
19 function __construct($name, $title, $className = null, $allowHTML = false, $form = null) {
20 // legacy handling for old parameters: $title, $heading, ...
21 // instead of new handling: $name, $title, $heading, ...
22 $args = func_get_args();
23 if(!isset($args[1])) {
24 $title = (isset($args[0])) ? $args[0] : null;
25 $name = $title;
The code in my PageInt.php file as per the error is:
class PageInt extends Page {
static $db = array(
'contentBlurb' => 'HTMLText',
'Right' => 'HTMLText',
);
static $has_one = array(
'IntslideImageOne' => 'Image',
'IntslideImageTwo' => 'Image',
'IntslideImageThree' => 'Image',
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new HtmlEditorField('contentBlurb', 'Interior Blurb'));
$fields->addFieldToTab("Root.Content.Main", new HtmlEditorField('Right', 'Right Content'));
$fields->addFieldToTab("Root.Content.Images", new LabelField("XXX")); <--- Line 22
$fields->addFieldToTab("Root.Content.Images", new ImageField('IntslideImageOne'));
$fields->addFieldToTab("Root.Content.Images", new ImageField('IntslideImageTwo'));
$fields->addFieldToTab("Root.Content.Images", new ImageField('IntslideImageThree'));
return $fields;
}
}
Any help would be appreciated here. Thanks.
Mario