Silverstripe Version: 4.9
Question:
So I’ve been struggling with this at every start of new projects, I extend the Member class, I declare the extension of Members in the config.yml, the new fields are created in the database so everything up to there works fine. Though when I try to see the new fields in the admin area, they don’t show up despite following the exact code that is meant to make the fields appear. So what am I missing?
Here is the MemberExtension.php, fields are created but don’t show up in the admin area, I tried with addFieldsToTab, push, one field, an array of fields, Root.Extensions instead of Root.Main, nothing works, I did several Dev Build with Flush all, still nothing
I also tried with updateMemberFormFields($fields) and push, it doesn’t work either
<?php
use SilverStripe\Security\Permission;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
class MemberExtension extends DataExtension
{
private static $db = [
'Country' => 'Varchar(64)'
];
public function updateMemberFormFields($fields)
{
Debug::show($fields);
$fields->push(TextField::create('Country','Country'));
}
/*public function updateCMSFields($fields)
{
Debug::show($fields);
$fields->addFieldToTab('Root.Main', TextField::create('Country','Country'));
}*/
}