I have encountered an issue when using the preload filter feature on a grid in GridPHP version 2.8 with a MySQL database.
Specifically, when applying the following preload filter:
$sarr = <<< SEARCH_JSON {“groupOp”:“AND”,“rules”:[{“field”:“commodity”,“op”:“in”,“data”:“PHONE”},{“field”:“region”,“op”:“in”,“data”:“AMR”},{“field”:“dtype”,“op”:“in”,“data”:“EWOS”}]} SEARCH_JSON; $opt2[“postData”] = array(“filters” => $sarr);
The SQL query generated by GridPHP is always empty. I enabled debug mode with $grid2->debug_sql = 1 to observe this.
However, if I modify the filter to remove the region field or duplicate it, the SQL query generates correctly without issue. For example, both of the following filters work fine:
$sarr = <<< SEARCH_JSON
{"groupOp":"AND","rules":[{"field":"commodity","op":"in","data":"PHONE"},{"field":"dtype","op":"in","data":"EWOS"}]}
SEARCH_JSON;
$sarr = <<< SEARCH_JSON
{"groupOp":"AND","rules":[{"field":"region","op":"in","data":"AMR"},{"field":"commodity","op":"in","data":"PHONE"},{"field":"region","op":"in","data":"AMR"},{"field":"dtype","op":"in","data":"EWOS"}]}
SEARCH_JSON;
This problem first drew my attention when a user experienced a network connection error after applying various filters. After testing, I confirmed the issue arises during the preload filter process when GridPHP tries to construct the SQL query.
Please advise on how to resolve or further diagnose this behavior.
By my guess, it looks like some application middleware is removing certain querystring or post variables, which includes ‘region’. There is no such thing in library not to pass ‘region’ as variable and pass all others.
To debug this, you can debug the $_POST and $_GET and see if its not removed.
error_log(print_r($_POST, true));
Let me know if still now solved.
PS: You can put the debug log just before the inclusion of /lib/inc/jqgrid_dist.php in your code.
Please send me the database schema to regenerate this case and debug where actually it is gone missing.
You can either send me on live chat or email at [email protected]
Related grid code and database structure will be required to regenerate the case.

