Skip to content
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

Fix module routing in RouterFactory #3

Closed
wants to merge 1 commit into from
Closed

Fix module routing in RouterFactory #3

wants to merge 1 commit into from

Conversation

pilarik31
Copy link

Hi,

looks like currently, module routing is broken.
Fixed that by adding <module> to the mask.

@dg
Copy link
Contributor

dg commented Dec 1, 2021

What exactly was broken?

@pilarik31
Copy link
Author

Nette is looking for Admin presenter at App\Module\Presenters\AdminPresenter, which is incorrect, since that presenter is now in App\Module\Admin\Presenters\AdminPresenter.

With <module> in the mask, it finds the presenter, and correctly redirects me to login, if I'm not logged in.

Also, without the module in the mask, the index is trying to do some weird URL.

@dg
Copy link
Contributor

dg commented Dec 1, 2021

I see. And the URL /admin/dashboard is mentioned where, in the documentation?

@pilarik31
Copy link
Author

pilarik31 commented Dec 1, 2021

There aren't any specific URLs in the repo's readme, so I just looked at the old commit, before implementation of modules, and it worked like:

  • /sign/* - SignPresenter
  • / - DashboardPresenter

And with the modules stucture, that broke.

That /admin/ is basically the module.

@dg
Copy link
Contributor

dg commented Dec 1, 2021

Yes, url has changed but I still don't understand why it is broken… This seems more like feature request.

@pilarik31
Copy link
Author

pilarik31 commented Dec 1, 2021

In the current state, I can't get it to work at all.
Clean install from the repository, following the installation guide, is resulting in this malformed URL.

Even if I manually try to access for example /sign/in, Nette's searching for presenter in path without the module name, so it results in exception.

And /admin/sign/in is currently not routed.

@dg
Copy link
Contributor

dg commented Dec 1, 2021

I understand now. It looks like the built-in PHP server has a "feature" that when there is a dot in the URL, it doesn't work properly https://bugs.php.net/bug.php?id=61286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants