Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving product overloads PHP max_input_vars #18

Open
fireproofsocks opened this issue Oct 29, 2014 · 1 comment
Open

Saving product overloads PHP max_input_vars #18

fireproofsocks opened this issue Oct 29, 2014 · 1 comment
Labels

Comments

@fireproofsocks
Copy link
Member

Getting some errors in the PHP logs like this:

2014/10/28 20:41:42 [error] 11812#0: *1721 FastCGI sent in stderr: "PHP message: PHP Warning:  
Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in 
Unknown on line 0" while reading response header from upstream, client: 123.123.123.123, server: 
somesite.com, request: "POST /manager/?a=2&class=product&method=edit HTTP/1.1", upstream: 
"fastcgi://unix:/tmp/somesite.com.sock:", host: "somesite.com", referrer: 
"http://somesite.com/manager/?a=2&class=page&method=productedit&product_id=8"

PHP 5.4.33
NGINX

Within the MODX controllers, the GET/POST/COOKIE data gets merged into $scriptProperties

@fireproofsocks
Copy link
Member Author

The standard response is to edit the setting in the php.ini, e.g. to

max_input_vars = 2000

(up from the default 1000).

The culprit is the product edit form: it puts all its eggs into one basket, so to speak: it doesn't fire off (many) Ajax requests, it just submits the single form with all its goods. But when you've got a lot of assets, taxonomies, and options, you create a LOT of variables. Their numbers increase exponentially when new options are added. Each spot in the arrays counts as a variable against the max_input_vars setting. It's like trying to shove too many marbles into too small of a jar.

To refactor this, the first priority would be to refactor the "Options" tab because that's where the biggest use of input vars is. E.g. modal windows with separate post-submits for each option, but even that could run out of input_vars... sigh. No easy fix here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant