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

Message: "Internal Server Error"


Go to End


5 Posts   3232 Views

Avatar
suntrop

Community Member, 141 Posts

4 May 2015 at 12:14am

When I click the translate button for a page, I see a message window at the top that says "Internal Server Error". The page is created, but the whole sitetree on the left disappears and I need to reload my browser.

How do I know what kind of error occurs? What happens?

Avatar
nzstephenf

Community Member, 63 Posts

4 May 2015 at 1:33am

What I'd suggest doing is add to the end of the URL "?isDev=1" or set your project development mode to 'dev'. This can be done through your mysite/_config.php by adding the line:

Director::setEnvrionmentType('dev');

If you're not receiving any print-outs of errors, add php_flag display_errors on to your .htaccess file which will allow all errors to appear.

What module are you using to 'Translate' a page?

Avatar
JonoM

Community Member, 130 Posts

5 May 2015 at 2:57pm

Fatal errors should appear in your PHP error log too, so you could look there. You might have to enable error logging first.

When messages appear at the top right corner it's usually the result of an ajax request so you probably won't see the full error message in the notification - but you can access it by opening your Developer Tools in the browser, then going to the Network tab and filtering for XHR requests. Any failed requests should be shown in red, and if you click on the name information about the request will be displayed below. Click the Response tab and with luck, you'll see a bunch of information about the error there. The site will need to be in Dev Mode for this to work.

You'll need to have Dev Tools open when you trigger the error for it to show up there, and I'm assuming you're using Chrome.

Avatar
suntrop

Community Member, 141 Posts

8 May 2015 at 7:41am

Thanks guys. I enabled the dev-mode and saw it is a bug of the Userforms module. It seems to be a known bug. There were two other pages that caused the same message ot the top, but I can't find them. Error log is full of errors :) Upgrading from 2.4 to 3.1 wasn't a smooth and easy task :-)

Avatar
nzstephenf

Community Member, 63 Posts

8 May 2015 at 11:04am

Edited: 08/05/2015 11:09am

Ah! I see, you're upgrading. Upgrading can be a pain, huh? Hahaha.

As some helping tips - check all your Page types and see if your code is using the right methods (this is just an example):

2.4 Example..

<?phe

class Page extends SiteTree {
    public static $db = array (
        "Snippet" => "Text",
        "ShowInFooter" => "Boolean"
    );

    function getCMSFields (){
        $fields = parent::getCMSFields();
        $fields->addFieldToTab ("Root.Main", new TextareaField (Snippet"), "Content");
        $fields->addFieldToTab("Root.Main", new CheckboxField("ShowInFooter", "Show in Footer"), "Content");

    return $fields;
    }

    class Page_Controller extends ContentController {

        public static $allowed_actions = array ();

        public function init (){
            parent::init ();
        }

    }

3.1 Example..

<?php
    class Page extends SiteTree {

        private static $db = array (
            ...
        );

        public function getCMSFields(){
            ...
        }

    }

    class Page_Controller extends ContentController{

        private static $allowed_actions = array ();

        public function init (){
            ...
        }

    }

Differences are that in your page type's class. You'll need to swap out the public in your statics for private. Functions can be left as public.

In your page type'a controller, you'll just need to change the static $allowed_actions from public to private.

Also another note, some features that existed in 2.4 may no longer exist, are depreciated or altered on 3.1. So for that you may want to see the Silverstripe Docs site.

If you need more help, just reply back with more on your situation :)

P.S. This was all typed on my phone so it might look a little off.

Stephen