8000 [Routing] Bad DX when generate a null named route · Issue #28634 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Routing] Bad DX when generate a null named route #28634
Closed
@matthieumota

Description

@matthieumota

Symfony version(s) affected: 4.1.x

Description
We know that UrlGenerator is cached on Symfony. Code is generated by PhpGeneratorDumper in Routing component. We can easily see that if $name arg is null and $locale exists in context (_locale parameter), RouteNotFoundException will not be thrown.

How to reproduce
Easy, install skeleton, install translations and call dump($this->container->get('router')->generate(null));, you will see "Undefined index: .en"

Possible Solution
I already write a fix but... I see that PhpGeneratorDumper is greatly improved on master, so what I can do ? Purpose my fix on 4.1 ? (Feature code only exists from 4.1 not before) Or we simply wait 4.2 release and code will fallback to 4.1 with branch strategy ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)Routing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0