Recently I’ve found one interesting issue and solution to it.
It appeared in module that allows to reorder categories in a tree view using drag’n’drop.
After some investigation, we found that server side receives only 500 top level items in $_POST, each of them consisted of 2 subitems: “parent_id” and “order”. So totalling of 1000 variables. But problem was that count of categories inside tree was more than 900 and php interpreter limited this number to 500 (1000 / 2).
There were several ways to fix:
* increase through ini_set(“max_input_vars”, 5000)
* change module somehow
I choosed second variant, as exists probability, that inside some production environment, we cannot change this ini variable.
Solution was to switch sending of drag’n’drop reordering result into serialized JSON string and do json_decode($_POST[“items”]) on server side.
Inside modern browsers exists such JS method: JSON.stringify(items).