Adding field to member

Silverstripe Version:
latest
Question:
Just trying to get back into SS, it’s been a while so starting over slowly again… but if someone could point out what i did wrong when i tried to extend a member to add a field?
I did the following:

i added a file app/_config/config.yml with

SilverStripe\Security\Member:
  extensions:
    - MyMemberExtension

Created a new file in my app\src\extensions\MyMemberExtension.php

<?php

use SilverStripe\ORM\DataExtension;

class MyMemberExtension extends DataExtension 
{
    // define additional properties
    private static $db = [
	'MowerName' => 'Varchar'
     ]; 
}

Then did a /dev/build on my site, and now my site looks like it’s missing tags and only half there, and the admin screen is very screwy as well.

I followed Extensions – SilverStripe Documentation

If someone could point out what i’ve done wrong?
Thanks
Grant

Nothing jumps out in the code you posted. It may be that you are seeing the result of a different issue.
When you did the build, were your new fields added to the member table?

A couple of other questions:

  • Is the site in dev mode?
  • Are there any errors shown?
  • Are you seeing errors in the browser console?

Hi ya,
Took me a couple of days to get back to this, but turns out it was my app/_config.php file, i don’t think that notepad++ put a cr/lf after the <?php… ??
Anyhow - i think it’s fixed.

Thanks
Grant