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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Access level to ErrorPage::$db must be public


Reply


3 Posts   584 Views

Avatar
SilverPeed

Community Member, 12 Posts

13 February 2014 at 4:10am

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

Avatar
kinglozzer

Community Member, 151 Posts

13 February 2014 at 5:15am

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

Avatar
SilverPeed

Community Member, 12 Posts

18 February 2014 at 2:04am

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.