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

My controller does not redirect correctly - multiform


Go to End


3 Posts   1971 Views

Avatar
otherjohn

Community Member, 125 Posts

8 October 2010 at 8:10am

Hi all,
I have created a controller which has multiform on it.
The form shows fine but it doesn't redirct on submission correctly. I get a 404 error

<?php

class FBController extends Controller 
{ 
	static $allowed_actions = array (); 
	
	
	function FacebookSetupMF() {
             return new FacebookSetupMF($this, 'FacebookSetupMF');
   	}
}

form shows correctly at domain.com/FBController/
but when I submit it goes to domain.com/FacebookSetupMF?MultiFormSessionID=cb7feaaf9e07dc5ff0fa6f8f48d49100ae289bc8

and I get a Page not found?

Avatar
DesignCollective

Community Member, 66 Posts

20 July 2012 at 9:53am

Edited: 20/07/2012 9:53am

Did you ever find a solution to this? I am having exactly this challenge :)

Avatar
martimiz

Forum Moderator, 1391 Posts

22 July 2012 at 1:56am

In this example SilverStripe is looking for a page called FacebookSetupMF, when in fact this is meant as an Action parameter for your controller telling it to call the FacebookSetupMF() function instead.

So you have to tell your controller to allow that:

static $allowed_actions = array ('FacebookSetupMF');