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

3.1.10 Controller is redirecting to LoginForm


Go to End


4 Posts   537 Views

Avatar
timo

Community Member, 47 Posts

1 April 2015 at 9:44pm

Is this issue solved?
https://github.com/silverstripe/silverstripe-framework/issues/3131

i did :

class Shop_Controller extends Page_Controller {

	public static $allowed_actions = array ('basket');

	public function init() {
		parent::init();
	}
	
	 
	public function basket(SS_HTTPRequest $request){ 
		
		$fields = new FieldList( 
            new TextField('firstname', 'Vorname'),
			 new TextField('lastname', 'Nachname'), 
            new EmailField('email', 'Email'), 
            new TextField('tel', 'Telefon')
        ); 
        $actions = new FieldList( 
            new FormAction('processPayment', 'Jetzt Bezahlen') 
        );
		 
        $validator = ''; 
		
		$form = new Form($this, 'processPayment', $fields, $actions, $validator);
		
		$Data = array(
			'Breadcrumbs' => 'Shop / Ihr Warenkorb', 
			'Title' => 'Shop / Ihr Warenkorb', 
			'BasketForm' => $form
		);
		
		return $this->customise($Data)->renderWith(array('Basket', 'Page')); 
		
	}
	

	public function processPayment(SS_HTTPRequest $request) {
		
	}	
	
}

******************************************************************************

//_config.php:

Director::addRules(100, array(
	'shop//basket' => 'Shop_Controller'
));

What am i doing wrong?
thanks.timo.

Avatar
Pyromanik

Community Member, 419 Posts

2 April 2015 at 3:09am

Your code is written for 3.0 or 2.x
You should first check the version is 3.0.x or older, or update the code.

Avatar
timo

Community Member, 47 Posts

2 April 2015 at 3:43am

Its 3.1.10

Avatar
timo

Community Member, 47 Posts

2 April 2015 at 3:48am

Edited: 02/04/2015 3:50am

if iam using
class Shop_Controller extends ContentController {
or
class Shop_Controller extends Page_Controller {

there is no redirect to login but
navigation is missing

as http://www.silverstripe.org/community/forums/template-questions/show/4907
but i cant see how to fix the missing navigation

timo