Jump to:

5523 Posts in 1734 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Custom MemberImport CSV

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

Page: 1
Go to End
Author Topic: 152 Views
  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Custom MemberImport CSV Link to this post

    I'm using SS3.1, how can I replace the SecurityAdmin and MemberImportForm with my own custom methods to create a custom Member CSV import? I've tried

    Object::useCustomClass('SecurityAdmin','CustomSecurityAdmin');
    Object::useCustomClass('MemberImportForm','CustomMemberImportForm');

    and

    Object::add_extension('MemberImportForm','CustomMemberImportForm');
    Object::add_extension('SecurityAdmin','CustomSecurityAdmin');

    I've also attempted .yml settings, but I'm not very knowledgeable about YAML.

    but neither of them work. Other than hacking the framework directly, is there a more elegant solution?

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: Custom MemberImport CSV Link to this post

    maybe this will work
    MemberImportForm::add_extension('CustomMemberImportForm');

  • MarijnKampf
    Avatar
    Community Member
    164 Posts

    Re: Custom MemberImport CSV Link to this post

    That doesn't work either. MemberImportForm does loads of initializing in the __construct(...). The constructor can't be called when extending Extension rather than Form.

    Tried going one level deeper to SecurityAdmin, but similiar issue with calling parent::init() function. Fatal error: Call to undefined method Extension::init() in E:\localhost\cbyc\mysite\code\CustomSecurityAdmin.php on line 35. I get stuck as I don't know how I can call the parent of $this->owner.

    152 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.