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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Custom MemberImport CSV


Go to End


3 Posts   907 Views

Avatar
MarijnKampf

Community Member, 176 Posts

13 May 2014 at 1:20am

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?

Avatar
thomas.paulson

Community Member, 107 Posts

13 May 2014 at 2:00am

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

Avatar
MarijnKampf

Community Member, 176 Posts

13 May 2014 at 2:51am

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.