-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Impossible to use tag
as GET parameter
#171
Comments
NOTE: this update renames the "tag" parameter to "primary_tag". This is due to a core issue being tracked at flarum/core#2490
I'm not actually sure whether that's a Mithril or Flarum issue. But it's certainly code in Flarum that's blocking the ability to use those names right now. In our RouteResolver, we pass down all This behavior is documented in Mithril, and does not come with any warning https://mithril.js.org/route.html#routeresolverrender The code triggering the issue seen is in The I have no idea why there is a check for There might be more in the detailed commits on the older Mithril rewrite branch. Paging @datitisev who might know more. Looking at the older Mithril documentation and older code from Flarum, I don't even think I have tested removing the If there was a Mithril reason for those explicit errors, we should probably check whether Mithril still disallows those values. If there's none, we should probably remove these errors to increase flexibility and avoid this very issue, which can also happen with user-entered parameters for whatever reason. If we really do need to keep the errors, then we should probably filter out those property names at the RouteResolver level as to not cause a routing error when they are used. We could probably also filter all of the values out except Similar but not the same MithrilJS/mithril.js#1271 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. |
Bug Report
NOTE: This might be a Mithril 2 problem, but I haven't been able to trace the issue so I'd rather not send this to them without being sure where it's coming from.
Current Behavior
Using
tag
as a GET parameter breaks the page.Steps to Reproduce
tag
(likehttps://flarum.localhost/?tag=hello
)Expected Behavior
All GET parameters being available. I know
tag
is a reserved name in Mithril components, but why that would apply to GET parameters is really beyond me -m.route.param()
returns a plainobject
, so the query parameters must be getting dragged through some component's attr at some other point in the stack.Error log
flarum info
The text was updated successfully, but these errors were encountered: