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.

Installing SilverStripe

Getting SilverStripe up and running on your computer and on your web server.

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

300 Bad Request on large UserForm


Reply

4 Posts   916 Views

Avatar
quanto

30 May 2013 at 2:36am Community Member, 81 Posts

Hi all,

I installed the FormBuilder Extension to a website. I'm going to use it for some large forms (a lot of restrictions, a lot of formfields). When i'm trying to update the form and I want to save & publish it, it returns the error message "300 bad gateway".

In the php.ini i set the post_max_size to 16M instead of 8M, but it didn't solve my problem.

Anybody a clue?

Avatar
Bambii7

31 May 2013 at 12:49pm Community Member, 254 Posts

Its hard to guess what the issue could be without knowing more details.

Is it possible to capture the apache error log for more detail? Running the following in a terminal on your server.

>>tail -f /var/log/apache/error.log

Avatar
quanto

1 June 2013 at 12:34am Community Member, 81 Posts

Error.log is empty. My Firebug gives the message

There seems to have been a technical problem. Please click the back button, refresh your browser, and try again.

wich can be found overhere: (/framework/forms/Form.php)

   public function httpSubmission($request) {
      $vars = $request->requestVars();
      if(isset($funcName)) {
         Form::set_current_action($funcName);
      }
      
      // Populate the form
      $this->loadDataFrom($vars, true);
   
      // Protection against CSRF attacks
      $token = $this->getSecurityToken();
if(!$token->checkRequest($request)) {
         $this->httpError(400, _t("Form.CSRF_FAILED_MESSAGE",
            $request."There seems to have been a technical problem. Please click the back button,"
            . " refresh your browser, and try again."));
      }
....
}

But I don't have any idea why it is not getting the token, because it seems to be in the $_POST

Avatar
quanto

3 June 2013 at 8:25pm Community Member, 81 Posts

I solved it by setting the max_input_vars to 2000. For more information check http://anothersysadmin.wordpress.com/2012/02/16/php-5-3-max_input_vars-and-big-forms/