Jump to:

1160 Posts in 2621 Topics by 409 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Access level to ErrorPage::$db must be public

Ask questions about upgrading SilverStripe to the latest version.

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

Page: 1
Go to End
Author Topic: 464 Views
  • SilverPeed
    Avatar
    Community Member
    12 Posts

    Access level to ErrorPage::$db must be public Link to this post

    I have an error when dev/building my site and don't quite understand this problem.

    The error i get is:
    Fatal error: Access level to ErrorPage::$db must be public (as in class Page) in /home/deb78737/domains/gitaarhero.nl/public_html/cms/code/model/ErrorPage.php on line 310

    The answer i found on the silverstripe page does not work for me. --> link: http://doc.silverstripe.org/framework/en/changelogs/3.1.0

    When i change my statics to private nothing is working anymore. When i change it back to public the front-end works but the CMS does not work anymore.

    I'm using Silverstripe 3.2.1

  • kinglozzer
    Avatar
    Community Member
    139 Posts

    Re: Access level to ErrorPage::$db must be public Link to this post

    Hi SilverPeed,

    The documentation you linked to is correct, you need to change 'public static' to 'private static'. After you've done this, you'll need to visit http://mysite.com/dev/build?flush=1 - I suspect that this is why it wasn't working for you.

    If that doesn't solve the issue, make sure that both the CMS and Framework have been updated to 3.1.2 (and any modules are compatible with 3.1).

    Loz

  • SilverPeed
    Avatar
    Community Member
    12 Posts

    Re: Access level to ErrorPage::$db must be public Link to this post

    Thanks for you answer,

    I probably made a typo somewhere
    I removed all the files except Page.php in my "Code" en replaced the code of Page.php with the original Code.
    Did a Dev build en it worked. When i put my other files back in the "Code" folder, those worked as well.

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