Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Route with default value for query string param causes param to get eaten #10940

Copy link
Copy link
Closed
@nickshanks

Description

@nickshanks
Issue body actions

Given a route like this:

book:
    path: /book
    defaults:
        page: 1

I would expect generate('book', {'page': $page}) to generate these routes:

  1. /book when $page == 1
  2. /book?page=2 when $page == 2

What actually happens is that when a parameter has a default value, but is not present in the route path, it just gets eaten by Symfony. Both of the above values for $page result in the path /page being generated.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.