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.

Customising the CMS /

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


Reply


3 Posts   1284 Views

Avatar
timon

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
timon

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.