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 /

[SOLVED] Custom Site Config


Reply


6 Posts   2423 Views

Avatar
KoJans

Community Member, 14 Posts

19 July 2011 at 2:27am

Hi all!

I' trying to extend my SiteConfig, and followed the example on: [url]http://doc.silverstripe.org/sapphire/en/reference/siteconfig[/url]. But after http://.../dev/build?flush=all I get this errormessage:

Fatal error: Object::add_extension() - Can't find extension class for "CustomSiteConfig" in /var/www/silverstripe/sapphire/core/Object.php on line 526

.
What have I done wrong?

Avatar
swaiba

Forum Moderator, 1799 Posts

19 July 2011 at 2:53am

here's another doc...
http://www.ssbits.com/tutorials/2010/2-4-working-with-siteconfig/

but it sounds like you have missed the "<?php" tag as it hasn't got any of that code you've added - total guess though

Avatar
KoJans

Community Member, 14 Posts

19 July 2011 at 4:20am

Thanks,

I'll have a look at ssbits.
Adding the <?php didn't do the trick...

Avatar
swaiba

Forum Moderator, 1799 Posts

19 July 2011 at 4:35am

Adding the <?php didn't do the trick...
So it wasn't there before? That's not good - all the php code needs to start with that.

If it wasn't there and you've added it... then you need a dev/build... but that is probably still failing - remove the "Object::add_extension()" part, deb/build, then re-add the "Object::add_extension()" and dev/build again

Avatar
KoJans

Community Member, 14 Posts

19 July 2011 at 7:32am

Thanks again!

That worked. Silly of me to forget the <?php part... I'll remember this!

Avatar
vodoomoth

Community Member, 22 Posts

27 December 2012 at 6:36am

You might also want to delete the contents of your temporary folder.

I had to delete the contents of Windows\Temp\<SilverStripe temp folder> before the "Fatal error: Object::add_extension() - Can't find extension class" disappeared.