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

Changing identifier in route hook #9388

Closed
hypeJunction opened this Issue Feb 15, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@hypeJunction
Contributor

hypeJunction commented Feb 15, 2016

Should the core run the route hook on a new identifier if the route hooks changes the original identifier? e.g. if hook routes 'courses/all' to 'groups/all', all route hooks registered for 'groups' will never be fired. It seems that they should be.

@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay

mrclay Feb 15, 2016

Member

Changing identifier/segments in a handler potentially means partial calling of handlers for the old id and the new id, and we still don't have a clean way to change stuff like current_page_url().

I'd prefer (ideally) a hook to alter the request object before core reads stuff out of it, or a "route:before" hook specifically for changing id/segments (and deprecate doing so in "route").

Member

mrclay commented Feb 15, 2016

Changing identifier/segments in a handler potentially means partial calling of handlers for the old id and the new id, and we still don't have a clean way to change stuff like current_page_url().

I'd prefer (ideally) a hook to alter the request object before core reads stuff out of it, or a "route:before" hook specifically for changing id/segments (and deprecate doing so in "route").

@hypeJunction

This comment has been minimized.

Show comment
Hide comment
@hypeJunction

hypeJunction Feb 15, 2016

Contributor

I would be happy with either.

Contributor

hypeJunction commented Feb 15, 2016

I would be happy with either.

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Feb 15, 2016

feature(routing): allow more reliable URL path rewriting
Adds an early called `route:rewrite` hook expressly for URL rewriting.
Changes there update the request object and affect the default context,
and functions like current_page_url().

Removes legacy magic quotes-related code.

Fixes #9388
@mrclay

This comment has been minimized.

Show comment
Hide comment
@mrclay
Member

mrclay commented Feb 16, 2016

PR #9390

mrclay added a commit to mrclay/Elgg-leaf that referenced this issue Feb 16, 2016

feature(routing): allow more reliable URL path rewriting
Adds an early called `route:rewrite` hook expressly for URL rewriting.
Changes there update the request object and affect the default context,
and functions like current_page_url().

Removes legacy magic quotes-related code.

Fixes #9388

@mrclay mrclay closed this in #9390 Feb 16, 2016

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