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

Request uri falls back to slash when page is missing #165

Merged
merged 1 commit into from
May 17, 2024

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented May 17, 2024

Fixes #134

We fake the request, then have a "gather content" step, and then we loop through everything later to generate them. Only in the later point do we set the page on our faked request.

Michael was running into the issue because he is trying to get the request url during the "gather content" step when there is no page defined yet.

This PR makes the path fall back to / when there is no page. This is consistent with how Symfony's request works. If you do request()->path() in a console command, you'd get /.

@jasonvarga jasonvarga merged commit 3bb1658 into master May 17, 2024
26 checks passed
@jasonvarga jasonvarga deleted the fix-missing-page branch May 17, 2024 19:40
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.

Exception when using request()
1 participant