Closed alex-code closed 9 years ago
can you explain a bit more how and why this can happen? and shouldn't we fix the cause then rather then working around it?
Say you have a GridView
with a filter wrapped with PJax
.
When you change the GridView filter Pjax catches the form submit and appends _pjax
to the querystring.
Now in your action where you render the GridView it sets the filterUrl
to Yii::$app->request->url
which now includes the _pjax
param.
If you change the filter again the applyFilter
function in yii.gridView.js
parses the querystring in filterUrl
when building the hidden form.
Pjax then serializes that form into an array and adds the _pjax
parameter again.
Reproduced. The fix works fine
I think it's better to solve this problem on js side than touch PHP part of Yii
Thank you!
If pjax receives data as an array you can end up with duplicate secret parameters
_pjax=#container
Can occur with a filter on a
GridView
.