-
-
Notifications
You must be signed in to change notification settings - Fork 168
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 displaying (singleton) page by slug #1921
Fix displaying (singleton) page by slug #1921
Conversation
Hi @denis-gorin, How are you triggering this? Are you calling the method yourself, instead of via routing? AFAIK, it should always be a string already, even if it's a numeric one. |
when I call
Request info
|
Confirm, have the same error. This PR fixes it |
@denis-gorin could it be that the param converter is trying to be smart and type hints the
rather than casting it to a string? |
exactly that it was The roots of an //src: src\Controller\Frontend\ListingController.php:61
return $this->forward($controller, ['slugOrId' => $content->getId()]); ... trying to "list" a singleton, we're getting a single Content by Id |
@denis-gorin I've managed to reproduce it! Thanks for the extra info! We'll merge in, after Travis passes. @I-Valchev It's already typehinted as |
For those curious: I've looked it up, and this indeed got broken very recently. I introduced this bug here: #1884 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for fixing this @denis-gorin . I think we're ready to roll with this PR once the final test passes :-)
Fixes #1920
if we allow numeric slug
I suppose to convert numeric slug to String couse not to brake repository method
findOneBySlug