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

You must login with your CMS password... on Custom_Controller extends Page_Controller


Go to End


2 Posts   843 Views

Avatar
Vix

Community Member, 60 Posts

29 September 2015 at 9:29pm

Edited: 29/09/2015 9:29pm

I have a Custom_Controller that extends Page_Controller. I access some of the functions via routes.

routes.yml

---
Name: cartroutes
After: framework/routes#coreroutes
---
Director:
  rules:
    'xxx//$Action/$ID' : 'xxx_Controller'
---

Controller

class xxx_Controller extends Page_Controller {
	
	private static $allowed_actions = array (
	    'View'
	);
	
	private static $url_handlers = array(
        'delete/$ID!' => 'View'
    );

All of this works fine on my local machine. However when I load it to my dev server I get the error:

You must log in with your CMS password in order to view the draft or archived content. <a href="/xxx_Controller/?stage=Live">Click here to go back to the published site.</a>

I don't have anything in this controller that specifies whether it is staged, live etc

I am using 3.1.14 (tried reverting to 3.1.13 but no luck)

Anyone know what to do to resolve this?

Thanks

Avatar
Vix

Community Member, 60 Posts

30 September 2015 at 2:51pm

Strange.... the website has had a sleep and fixed itself...