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.

Customising the CMS /

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

popCurrent called on ModelAsController controller, but it wasn't at the top of the stack


Go to End


3 Posts   2118 Views

Avatar
tr

Community Member, 4 Posts

4 July 2011 at 10:34pm

Hi,

I receive the error message above if a non-existent controller action is called. On the fronted-side the message "I can't handle sub-URLs of a JobList_Controller object." is issued (HTTP status 404) instead of showing the site's error page.

My controller looks basically like this:

<?php
class JobList_Controller extends StaticPage_Controller {

    public static $allowed_actions = array(
        'view',
        'back'
    );

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

    public function view() {
        // code here
    }   

Any ideas what's going wrong here?

Avatar
tbilyn

Community Member, 9 Posts

5 July 2011 at 1:58am

It can be becouse you error page in the site tree is not published, try to 'Save and Publish' it.

Avatar
tr

Community Member, 4 Posts

5 July 2011 at 2:02am

The error page is published and gets displayed correctly - except for SiteTree_Controller subclasses that implement own actions.