21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 273 Views |
-
Decorating doesn't work (in any case)

13 March 2012 at 4:20am Last edited: 13 March 2012 4:21am
Hi,
I am trying to get the decorating thing for Memberclass working. Unfortunately, how hard I try (following literally the examples on the silverstripe website), it isn't working, I get an error when running de/build/:
Fatal error: Object::add_extension() - Extension "CommissionDescription" is not a subclass of Extension in C:\[path]\sapphire\core\Object.php on line 530
Currently I am using silverstripe 2.4.5.
I use for CommissionDescription:
class CommissionDescription extends DataObjectDecorator {
// some thing like extraStatics in here
}and in the mysite/_config.php file:
Object::add_extension('Member', 'CommissionDescription');
Does this give some of you any clue on what might be going on?
Thanks in advance,
Maurice -
Re: Decorating doesn't work (in any case)

13 March 2012 at 4:51am
Hi,
You have the right syntax, however what can happen is that if the object hasn't been built yet then the stuff in the _config.php will fail.
So comment the stuff in the _config.php, dev/build, then un comment and dev/build again. Hopefully that will fix it.
-
Re: Decorating doesn't work (in any case)

16 March 2012 at 4:31am
Jep, that just fixed it for me, thanks! Now I can finally use the decoration functions!
| 273 Views | ||
|
Page:
1
|
Go to Top |


