-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
Description
Symfony version(s) affected
7.4.0-rc
Description
Hi!
I'm testing my project on symfony 7.4, after upgrading beta to rc my app broke.
The issue is related to this 2 packages:
- Upgrading symfony/dependency-injection (v7.4.0-BETA2 => v7.4.0-RC1)
- Upgrading symfony/framework-bundle (v7.4.0-BETA2 => v7.4.0-RC1)
my routes are changed.
Before:
admin.login ANY admin.project.local /login
portal.login ANY project.local /login
After:
login ANY ANY /login <- this was not there and derails my request to *.project.local/login
admin.login ANY admin.project.local /login
portal.login ANY project.local /login
Before:
bin/console router:match /login --host=admin.project.local
[OK] Route "admin.login" matches
+--------------+------------------------------------------------------------+
| Property | Value |
+--------------+------------------------------------------------------------+
| Route Name | admin.login |
| Path | /login |
| Path Regex | {^/login$}sDu |
| Host | admin.project.local |
| Host Regex | {^admin\.project\.local$}sDiu |
| Scheme | ANY |
| Method | ANY |
| Requirements | NO CUSTOM |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: App\Controller\Admin\LoginController::login() |
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
| | utf8: true |
+--------------+------------------------------------------------------------+
after:
bin/console router:match /login --host=admin.project.local
[OK] Route "login" matches
+--------------+-------------------------------------------------------------+
| Property | Value |
+--------------+-------------------------------------------------------------+
| Route Name | login |
| Path | /login |
| Path Regex | {^/login$}sDu |
| Host | ANY |
| Host Regex | |
| Scheme | ANY |
| Method | ANY |
| Requirements | NO CUSTOM |
| Class | Symfony\Component\Routing\Route |
| Defaults | _controller: App\Controller\Portal\LoginController::login() | <- changed
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
| | utf8: true |
+--------------+-------------------------------------------------------------+
How to reproduce
I have a system with multiple subdomains, my route config:
admin:
resource: '../src/Controller/Admin/'
type: attribute
host: admin.project.local
name_prefix: 'admin.'
portal:
resource: '../src/Controller/Portal/'
type: attribute
host: project.local
name_prefix: 'portal.'I have 1-1 LoginController under both of them:
<?php
declare(strict_types=1);
namespace App\Controller\Portal;
// or namespace App\Controller\Admin;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\Routing\Attribute\Route;
use Twig\Environment;
#[AsController]
final readonly class LoginController
{
#[Route('/login', name: 'login')]
public function login(Environment $twig): Response
{
return new Response($twig->render('portal/login.html.twig'));
// or return new Response($twig->render('admin/login.html.twig'));
}
}Possible Solution
No response
Additional Context
No response