I'm trying to add a default value to an HtmlEditorField in admin. I have it working on TextFields, but for some reason it just won't work on HtmlEditorFields.
Here's a snippet of my code, edited down to just the relevant bits:
<?php
class SiteConfigExtension extends DataExtension
{
private static $db = array(
'Message' => 'HTMLText'
);
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldsToTab('Root.Main', array(
$a = new TextAreaField('Message', 'Message', '<h2>Default Message...</h2>'),
));
$a->setRows(5);
Any ideas?
By the way, this is a problem that keeps occurring for me in various scenarios (not just with HtmlEditorFields but also with DropdownFields for example), but I've been unable to pin down the cause - it seems quite random.