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 |
I-Valchev
left a comment
There was a problem hiding this comment.
👍 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