How to reproduce :
1/ Create a model and a CRUD controller using Gii
2/ Create enough model instances to activate pagination
3/ set enableHistory to true in the associated index.php view file :
<?php $this->widget('zii.widgets.CListView', array(
Now, if you go to page 2, refresh the page in your browser (important), then click on the page 1 button in the pager, your url should look like :
The problem seems to come from the jquery.yiilistview.js file, line 36-37 :
var url = $(this).attr('href').split('?'),
params = $.deparam.querystring('?'+ url);
As there is no query string in the ajax request made to load page 1, url is undefined and a "undefined" key is created into the "params" array (with a empty value), which then cause "undefined" to appear in the url.
One simple fix may be to change line 37 for :
params = $.deparam.querystring('?'+ (url || ''));
Confirmed... the same fix should be applied to jquery.yiigridview.js
Would you like to try to create a PR ?
Sure, I will gladly try to do it :)
Just follow the guidelines... and if needed feel free to ask for help...
Fix query string problem #2078 with CListView and CGridView when enab…
Thank you for pointing me to the guidelines, they were very well written and easy to follow :)
Thanks for contribution.