Tuesday, September 1, 2015

Intermittent errors on Drupal Views

Observed on sites hosted on the Acquia platform; and generally where there has been a upgrade from PHP 5.2 / 5.3 on the environment.

The Symptom


On Drupal administrative screens;

1) the edit popups do not appear in some cases
2) the cancel buttons do not exit the dialog
3) all the attributes are not saved when a save is clicked, especially in large forms like the permissions editor
4) ajax error when using exposed filters on views for filtering

The Problem


Acquia recently suspended their support for PHP 5.2 through to 5.3 and have been upgrading all their environments to PHP 5.5 or above.

As of PHP 5.3.9 there was a PHP a new setting “max_input_vars” added which allows the server to throttle the number of variables that PHP will process. The value is defaulted to 1000.

Now with Drupal administrative views that causes a significant problem; as they are very heavy and being throttled to only a 1000 variables that can be processed just will not do.

Mortified at the number of variables the server will throw a 

PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.

The Solution


So the solution is just that; we need to increase the throttle on the number of variables that PHP can process.

On Acquia, this could be done on via the environment configuration option found on the Acquia workflow page (https://insight.acquia.com/cloud/workflow?s=xxxxxxx)


Here you can manipulate the slider for "Maximum Input Variables" to get the desired value. The value you want to set this to would differ according to your situation.

In our case we had to crank it all the way up to 2000.

Hope this helps someone out.

References;


https://www.virendrachandak.com/techtalk/big-forms-and-php-max_input_vars/
http://2bits.com/drupal/drupal-not-saving-admin-pages-large-number-input-fields.html
https://docs.acquia.com/cloud/configure/environments/php