Jump to:

23453 Posts in 18902 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » CustomSiteConfig should be compatible with DataExtension::extraStatics()

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 1522 Views
  • priithansen
    Avatar
    Community Member
    25 Posts

    CustomSiteConfig should be compatible with DataExtension::extraStatics() Link to this post

    I'm getting this line in my php log on every page load

    PHP Strict Standards: Declaration of CustomSiteConfig::extraStatics() should be compatible with that of DataExtension::extraStatics() in /ss3/mysite/code/CustomSiteConfig.php on line 17

    CustomSiteConfig.php files content

    <?php

    class CustomSiteConfig extends DataExtension {

       public function extraStatics(){
       return array(
       'db' => array(
          'FacebookLink' => 'Varchar(255)'
             )
          );
       }

       public function updateCMSFields(FieldList $fields) {
          $fields->addFieldToTab('Root.Main', new TextField('FacebookLink', 'Facebook Link'));
          $fields->removeByName('Theme');
       }
    }

    Using SS3 RC1 wiht MAMP and php version 5.3.6

    Any ideas what could be wrong with my code?

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: CustomSiteConfig should be compatible with DataExtension::extraStatics() Link to this post

    The upgrading documentation explains that extraStatics() is deprecated and you should just use

    public static $db = array(
       'FacebookLink' => 'Varchar(255)',
    );

    The error itself is because 3.0 now includes E_STRICT errors, so method declarations must match the declaration of the parent method it is overriding.

  • priithansen
    Avatar
    Community Member
    25 Posts

    Re: CustomSiteConfig should be compatible with DataExtension::extraStatics() Link to this post

    Thank You for the help, don't know how I missed that.

    1522 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.