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

BUG: Ignored segments in routes.yaml are not always ignored - Fix provided #1907

Closed
ASochat opened this Issue May 3, 2018 · 6 comments

Comments

Projects
None yet
2 participants
@ASochat

ASochat commented May 3, 2018

Ignored segments in routes.yaml are not always ignored, because of an error in the code:

Line 273 of StatamicController.php (parseUrl function), you're doing
$remove_segments = array_intersect_key($ignore, $segments);
while it should be:
$remove_segments = array_intersect($ignore, $segments);
A fix would be welcome :))

Thanks a lot!

@ASochat ASochat changed the title from Hello, We're running the latest version of Statamic. We noticed an error in the code. Line 273 of StatamicController.php (parseUrl function), you're doing `$remove_segments = array_intersect_key($ignore, $segments);` while it should be `$remove_segments = array_intersect($ignore, $segments);` A fix would be welcome :)) Thanks a lot! to BUG : Ignored segments in routes.yaml are not always ignored - Fix provided May 3, 2018

@ASochat ASochat changed the title from BUG : Ignored segments in routes.yaml are not always ignored - Fix provided to BUG: Ignored segments in routes.yaml are not always ignored - Fix provided May 3, 2018

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented May 3, 2018

How are you using the ignore array in routes.yaml?

@ASochat

This comment has been minimized.

ASochat commented May 3, 2018

Like this:

ignore:
  - airbnb
  - classic
  - absence
  - invest
@jasonvarga

This comment has been minimized.

Member

jasonvarga commented May 3, 2018

Can you give an example of a URL you hitting that isn't working correctly?

@ASochat

This comment has been minimized.

ASochat commented May 3, 2018

With the example above, foo.com/en/airbnb works but foo.com/en/classic doesn't, actually the segment isn't ignored in the URL before its rank in the "ignore section" in routes.yaml: classic just works if it's n°2 or more in the URL, like foo.com/en/something/classic. It continues like this after: foo.com/en/something/someother/absence works whereas foo.com/en/something/absencedoes not, and so on...

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented May 3, 2018

Thank you, that's perfect. 👍
Fixed for next release.

@ASochat

This comment has been minimized.

ASochat commented May 3, 2018

Thank you Jason :)

@jasonvarga jasonvarga closed this May 21, 2018

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