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

paginate:auto_links generating wrong links when lang is within a sub directory #1268

Closed
peda opened this Issue Feb 19, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@peda

peda commented Feb 19, 2017

Expected behaviour

When my blog for is hosted on http://localhost/de/blog I do expected the link to the second page to be
http://localhost/de/blog?page=2

Actual behaviour

The actual URL generated by auto_links is http://localhost/blog?page=2 (note the missing language folder)

Issue is located in CollectionTags.php line 465 ($paginator->setPath(URL::getCurrent());) as URL::getCurrent() just returns the path relative to the parent (in this case to http://localhost/en).

If temporarily fixed this by using $paginator->setPath(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); instead

Steps to reproduce

  1. Configure an additional language to be served from a sub directory (i.e. url: http://localhost/de/
  2. Create a page and put the {{ paginate:auto_links }} tag on it
  3. Click on any of the pagination buttons (previous, next, or direct page links) and get the wrong links

Server configuration

Operating system: CentOS 7.0

Web server: Apache2

PHP version: 7.0

Statamic version: 2.5.3

Updated from an older Statamic or fresh install: updated

@peda peda changed the title from paginate:auto_links generating wrong when lang is within a sub directory to paginate:auto_links generating wrong links when lang is within a sub directory Feb 19, 2017

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Aug 10, 2017

Sorry for the delay on this one. Thanks for bringing our attention to it. Fixed for next release.

@peda

This comment has been minimized.

peda commented Aug 10, 2017

Thanks

@jasonvarga jasonvarga closed this Aug 10, 2017

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