Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » "GridField doesn't have a modelClassName" error

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: 1315 Views
  • socks
    Avatar
    Community Member
    190 Posts

    "GridField doesn't have a modelClassName" error Link to this post

    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?

  • lx
    Avatar
    Community Member
    82 Posts

    Re: "GridField doesn't have a modelClassName" error Link to this post

    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)

  • iain_simpson
    Avatar
    Community Member
    1 Post

    Re: "GridField doesn't have a modelClassName" error Link to this post

    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

  • socks
    Avatar
    Community Member
    190 Posts

    Re: "GridField doesn't have a modelClassName" error Link to this post

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

    Thanks Iain.

    1315 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.