[Yii 1.1.11] enableHistory with SEO-friendly URLs breaks pagination #1246

Closed
ChessSpider opened this Issue Aug 17, 2012 · 3 comments

Comments

2 participants

enableHistory does not work with urlManager configured as

 'urlManager' => array(
                'urlFormat' => 'path',
                'showScriptName' => false,
        ),

The pagination does not work.

Steps to reproduce:

  1. Download Yii 1.1.11
  2. Configure urlManager as above
  3. Create a GridView with enableHistory enabled
  4. Try pagination and watch it do nothing

Adding "default" routes like

'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

only works when you do not use the Gridview in Modules. When you use the GridView in modules, it still breaks.

More information: http://www.yiiframework.com/forum/index.php/topic/34547-yii-1111-enablehistory-with-seo-friendly-urls-breaks-pagination/page__gopid__166910#entry166910

Owner

samdark commented Aug 17, 2012

If you use modules you should customize rules a bit more:

'<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>'=>'<module>/<controller>/<action>',
'<module:\w+>/'<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',

samdark closed this Aug 17, 2012

Yeah I figured. However that also means that I have to use QUERY-style URLs
(i.e. http://localhost/application/management/module/admin?Model_page=4)
If I use /* it still breaks.

Document it, or make it work as good as all the other Yii settings & components. I don't agree with this being closed so quickly as it is. Could be as simple as adding the line "enableHistory only works with Query-style URLs. A rule configured with /* will not work." in the documentation.

samdark reopened this Aug 22, 2012

This bug has been fixed as of version 1.1.13, release candiate:

Bug #1584: Fixed CGridView and CListView urls when enableHistory was used with "path" urlFormat (mdomba)

Thanks mdomba! Note this should also be closed..

ChessSpider closed this Dec 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment