-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Route Group problem with name attribute if not all routes are named #745
Labels
Comments
Same, though this occurs for me in the build a blog tutorial just before database set up: https://docs.masoniteproject.com/prologue/create-a-blog#database-setup using current PyPI release 4.17.4:
|
Well, I take mine back, I deleted, then rewrote the line ROUTES += Auth.routes() and now it works. I guess I copied badly? Sorry for the noise. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In trying to upgrade a project from Masonite 3 to 4, I noticed a change in behavior. When the Route.group has an overall name attribute, all the routes within the group also need to have names. This was not true in version 3 -- some could be left unnamed.
Expected behaviour
I believe this example, slightly modified from the documentation, should work:
My expectation is that the first route will use /dashboard/settings and have the name dash.settings and the second one will have the path /dashboard/monitor and will not be named at all. This should be visible in
python craft routes:list
The equivalent in masonite 3 worked as I expected and described above.Steps to reproduce the bug
At the moment, after adding this to routes/web.py on a new project, when you show the routes it throws a traceback:
There are two workarounds: either (1) add the name to every individual route in the group or (2) remove the name attribute from the overall group. With 2, you then need to repeat the group name prefix ("dash." in the example above) in each named route in order to get the same names. This defeats the point of having it at the group level.
Screenshots
No response
OS
Linux
OS version
Ubuntu LTS
Browser
Safari 16
Masonite Version
4.17.4
Anything else ?
No response
The text was updated successfully, but these errors were encountered: