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.

Data Model Questions /

Datamodel and version 2.4.2


Reply


4 Posts   1089 Views

Avatar
jseth

Community Member, 98 Posts

1 November 2010 at 8:08am

Is this link still relevent - http://doc.silverstripe.org/tutorial:2-extending-a-basic-site?
I've upgraded to version 2.4.2, used this to try to create a new page type and page, and when I do dev/build, the new pages do not appear in the CMS or the database.
I have a page type and page that I created using this tutorial when I was using version 2.3.8, and now the page, which has the added items to the CMS, will not open at all, and I get "error loading page" in the CMS (although it will load in the browser, just without the date and author info). I've tried changing the code for the date field, and removing the code for the additional fields completely, but nothing seems to be able to correct it. I also cannot create a new page. Can anyone help correct this? Thank you.

Avatar
Willr

Forum Moderator, 5513 Posts

1 November 2010 at 5:49pm

I get "error loading page" in the CMS (although it will load in the browser

If you look at your javascript error console (eg Firebug's console tab) you should be able to see the actual error message in the response tab. If you don't have Firebug, install it, if you don't see the detailed error then make sure your site is in dev mode (http://doc.silverstripe.org/debugging#dev_mode)

Avatar
jseth

Community Member, 98 Posts

3 November 2010 at 2:59am

Edited: 03/11/2010 3:00am

More info:

Folllowing your suggestion, and Uncle Cheese's "8 Common Silverstripe Errors" article, I set up the errors to be displayed, and also now get this when I click on the errant page in the CMS:

Notice: DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead. in /srv/www/htdocs/eastern/sapphire/core/model/DataObjectDecorator.php on line 60 Fatal error: Class 'CalendarDateField' not found in /srv/www/htdocs/eastern/mysite/code/LocalJobPage.php on line 30

I changed CalendarDateField to DatePickerField, and, I have no idea why it worked this time and not before, but NOW the pages open in the CMS!! I thought I had changed this before, but I guess I didn't do it correctly.

But I'm still getting "Notice: DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead. in /srv/www/htdocs/eastern/sapphire/core/model/DataObjectDecorator.php on line 60 "

What should I do about this?

Avatar
jseth

Community Member, 98 Posts

3 November 2010 at 3:39am

Found it!!!! I did a search for "extraStatics() silverstripe" and the info on page http://doc.silverstripe.org/dataobjectdecorator led me to do a search in my site for any files containing the text "extends DataObjectDecorator", and I found the offending newletterRole.php file. Made the change to extraStatics() from extraDBFields(), and the error is gone!

Thanks so much for pointing me in the right direction!