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.

General Questions /

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

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

"GridField doesn't have a modelClassName" error


Go to End


4 Posts   3540 Views

Avatar
socks

Community Member, 191 Posts

14 November 2012 at 7:38am

Edited: 14/11/2012 8:31am

SS3.0.3 rc1 although I think it was happening in 3.0.2 as well.

Seemingly at random times, a page in the CMS returns the error "Uncaught LogicException: GridField doesn't have a modelClassName, so it doesn't know the columns of this grid." The page throwing the error is using Page type - Page which is being used on many other pages throughout the site and those haven't exhibited any problems. So not sure why one is throwing the error and another is not.

So far the only remedy is to delete it via phpMyAdmin and then make a new one.

Thoughts?

Avatar
lx

Community Member, 83 Posts

16 November 2012 at 4:44am

I had the same problem. In my case it was also a simple Page of type Page.php.
My Page class has no extra $db, no $has_one or any other relation.
And it was just one page in the cms that didnt work.

Thanks for the tip, socks.
Removing the page from SiteTree and SiteTree_Live and adding it again in the cms has solved the problem (for now)

Avatar
iain_simpson

Community Member, 1 Post

23 November 2012 at 12:14am

Edited: 23/11/2012 12:19am

I've just encountered this issue, and it was because the page was the target of a RedirectorPage that had since been changed back to being just a plain Page.

Deleting the references in RedirectorPage and RedirectorPage_Live in the database solved the problem without having to recreate the pages in the CMS.

This looks like a bug in the way that pages are resolved in the back end, possibly just needing a check to see if a RedirectorPage entry is currently referenced by the SiteTree. I'll have a look to see if there's already a bug logged for this.

(Happening in 3.0.2 for me, by the way)

Edit: Looks like a known issue - http://open.silverstripe.org/ticket/7627 and http://open.silverstripe.org/ticket/8008

Avatar
socks

Community Member, 191 Posts

23 November 2012 at 5:29am

Yep, I was able to reproduce the former-target-of-a-Redirector-page issue.

Thanks Iain.