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.

Customising the CMS /

Custom MemberImport CSV


Reply


3 Posts   296 Views

Avatar
MarijnKampf

Community Member, 164 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, 86 Posts

13 May 2014 at 2:00am

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

Avatar
MarijnKampf

Community Member, 164 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.