5119 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 268 Views |
-
Extending the Group class

12 September 2012 at 2:00am Last edited: 12 September 2012 2:02am
I'm trying to add a method to the Group class using a DataExtension. The module I am modifying already adds DataExtensions to the Member and Member_Validating classes like this:
protected static function on_register() {
Object::add_extension('Member', 'ExternalAuthenticatedRole');
Object::add_extension('Member_Validator', 'ExternalAuthenticatedRole_Validator');
return parent::on_register();
}So I added my own line, before line 2:
Object::add_extension('Group', 'GroupObjectRole');
I added a file called GroupObjectRole.php to the same folder, and added a class GroupObjectRole extends DataExtension. However this results in a fatal error:
Fatal error: Object::add_extension() - Can't find extension class for "GroupObjectRole" in framework\core\Object.php on line 452
What am I doing wrong?
-
Re: Extending the Group class

12 September 2012 at 2:18am
Did you try doing a ?flush=all, or even a /dev/build?flush=1?
Another error I've made is forget to add <?php to the top of the file, which I know is very stupid but gives the same resulting error
-
Re: Extending the Group class

12 September 2012 at 3:24am
Done a /dev/build?flush=all and verified the <?php start but no luck.
-
Re: Extending the Group class

12 September 2012 at 3:45am
Trying adding the
to your _config.php in mysite(although this really shouldn't matter).Object::add_extension('Group', 'GroupObjectRole');
Double check the spelling of GroupObjectRole in your php file... A mistake i've often made.
And if you haven't try doing a ?flush=all without dev/build.
| 268 Views | ||
|
Page:
1
|
Go to Top |


