Silverstripe version 4.1.0
I have added some custom fields to the SiteConfig (settings menu). The fields are showing and when I enter something, press save, it says saved.
But when I go to another section (pages for example) and then go back to the settings page, my just entered fields are empty again.
Is this a possible bug?
This is the code I am using to add the fields.
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
class SentConfig extends DataExtension {
public static $db = [
'PoweredBy' => 'Varchar',
'PoweredByLink' => 'Varchar'
];
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldsToTab("Root.Main", TextField::create("PoweredBy", "Powered by"));
$fields->addFieldsToTab("Root.Main", TextField::create("PoweredByLink", "Powered by link"));
}
}
Cheers