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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

My controller does not redirect correctly - multiform


Reply


3 Posts   1191 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
KINKCreative

Community Member, 56 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, 1132 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');