Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@ChessSpider
Copy link

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

@samdark
Copy link
Member

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 samdark closed this as completed Aug 17, 2012
@ChessSpider
Copy link
Author

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 samdark reopened this Aug 22, 2012
@ChessSpider
Copy link
Author

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants