8000 Incompatibility between internationalized routing and prefix imported route names · Issue #27244 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Incompatibility between internationalized routing and prefix imported route names #27244
Closed
@pfx2

Description

@pfx2

Symfony version(s) affected: 4.1.0-beta

Description
When using "name_prefix" to prefix all names of some imported routes AND when defining an internationalized route, it's not possible to generate a route with the normal route name (not including the locale with the dot).

How to reproduce

  1. Add a name_prefix for some imported routes
front:
    resource: ../../src/Controller/Front
    type: annotation
    prefix: /
    name_prefix: front_
  1. Add an internationalized route in a controller matched by the previous definition
/**
 * @Route({
 *     "fr": "/test-fr",
 *     "en": "/test-en"
 * }, name="home_test")
 * @Template
 */
public function test(): array
{
    return [];
}
  1. You can't generate a route for "front_home_test", which would use the current locale, as excepted, you can only generate a route for "front_home_test.fr" and "front_home_test.en". If you remove the name_prefix and include "front_" inside the name of the route, it works as excepted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0