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.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

siteConfig DataExtension not saving, no default values

Go to End

2 Posts   765 Views


Community Member, 16 Posts

22 December 2013 at 3:59am

Edited: 22/12/2013 4:00am

Hi, I am trying to extend DataExtension, but the default values are not being displayed and any values are not being saved to the DB.


class AnalyticsConfig extends DataExtension {

  private static $db = array(
    'redisIP' => 'varchar(250)',
    'redisPort' => 'varchar(250)',
    'redisSize' => 'varchar(250)',

  public static $defaults = array(
    'redisIP' => '',
    'redisPort' => '6379',
    'redisSize' => '4832',

  public function updateCMSFields(FieldList $fields) {
    $fields->addFieldToTab("Root.Main", new TextField("RedisIP", "Redis IP"));
    $fields->addFieldToTab("Root.Main", new TextField("RedisPort", "Redis Port"));
    $fields->addFieldToTab("Root.Main", new TextField("RedisSize", "Redis Size"));


also, in _config.php i added

Object::add_extension('SiteConfig', 'AnalyticsConfig');

Any ideas?


Forum Moderator, 1848 Posts

24 December 2013 at 12:16am


Please see

Alternatively if you are not using 3.1 then look for older documentation. Also look at several small modules as these often have great examples of exending the silverstripe datamodel