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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

3.1 GridField Error in getCMSFields


Go to End


2 Posts   1607 Views

Avatar
cmc

Community Member, 33 Posts

26 October 2013 at 5:43pm

I have a GridField in my getCMSFields function for a subclassed page that's similar to the example in "Customizing Detail Forms" on this page of the documentation:

http://doc.silverstripe.com/framework/en/reference/grid-field

The code worked fine in SS 3.0.5, but with SS 3.1 I get the following error when I try to access a page of this type in the CMS

Call to a member function stat() on a non-object in httpdocs/framework/model/DataObject.php on line 3192

Any clues?

Avatar
cmc

Community Member, 33 Posts

13 November 2013 at 3:01pm

In case anyone else runs into this problem, as best I can tell the API for GridField changed with v 3.1 See -

http://doc.silverstripe.org/framework/en/reference/grid-field

The doc must have changed since I first posted my question because this is the same url referenced below.

I replaced my config setup for GridField in getCMSFields() with this line-

$config = GridFieldConfig_RecordEditor::create();

And defined my columns with the summary_fields property of the class used for the DataList and no longer have errors in the CMS.