Skip to content

Incorrect route matching logs in web profiler for route with condition and query parameters #25206

@qzminski

Description

@qzminski
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.13

The web profiler's route matching logs do not seem to correctly match the route although the route is in fact matched. Given we have a route configuration:

magazin:
    path: magazin
    condition: "request.query.has('page')"
    defaults: ...

The URL project.dev/app_dev.php/magazin?page=123 will be correctly mapped to that route but the profiler information does not seem to properly report that in the logs:

2017-11-29 at 10 25

I think this is related to #20621 and probably can be fixed in https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php#L86:

    private function getTraces(RequestDataCollector $request, $method)
    {
        $traceRequest = Request::create(
            $request->getPathInfo(),
            $request->getRequestServer(true)->get('REQUEST_METHOD'),
-           array(),
+           $request->getRequestQuery()->all(),
            $request->getRequestCookies(true)->all(),
            array(),
            $request->getRequestServer(true)->all()
        );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions