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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

SilverStripe 3 DataExtension


Reply


4 Posts   2452 Views

Avatar
El Kaz

Community Member, 2 Posts

15 July 2012 at 4:42pm

Edited: 15/07/2012 4:43pm

Hi,

I have recently upgraded to SilverStripe 3 and have attempted to convert current SiteConfig extensions to the new DataExtension model however now that SS is using strict mode, whilst in dev mode the following error occurs

Strict Standards: Declaration of UserConfig::updateCMSFields() should be compatible with that of DataExtension::updateCMSFields() in mysite\code\Users\UserConfig.php on line 27

The extension is actually working and the fields are being added to the settings area but it won't allow me to edit other pages within the CMS (the above error is dumped when clicking on a page in the pages section).

[url=http://doc.silverstripe.org/framework/en/trunk/howto/extend-cms-interface#create-a-bookmark-flag-on-pages]doc.silverstripe.org/framework/en/trunk/howto/extend-cms-interface[/url] Judging by this example I am doing everything correctly and even while leaving the updateCMSFields function completely blank it still dumps this error.

public function updateCMSFields(&$fields) {
}

Has anyone come across this issue and resolved it?

Avatar
Willr

Forum Moderator, 5513 Posts

15 July 2012 at 5:21pm

Looks like that documentation is out of date. It should match https://github.com/silverstripe/sapphire/blob/master/model/DataExtension.php#L159 (that is what strict mode is complaining about)

Avatar
El Kaz

Community Member, 2 Posts

16 July 2012 at 10:31am

Thanks for the reply Will.

I have tried copying the function from DataExtension (the version within my framework folder) and pasting it into my extended class and still get the compatibility error which is quite strange.

Is there any updated versions of SilverStripe I can try? Or is [url]http://www.silverstripe.org/stable-download[/url] the latest?

Avatar
Blackdog

Community Member, 156 Posts

20 July 2012 at 1:49am

Try this

      function updateCMSFields(FieldList $fields)
      {   

      }