Skip to content

Routing : wrong files loading in config/Routing/all.php #3101

Description

@Philalawst

The wrong files are being loaded in the src/Resources/config/routing/all.php file.

Before

<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return static function (RoutingConfigurator $routes): void {
    $routes->import('@FOSUserBundle/Resources/config/routing/security.php');

    $routes->import('@FOSUserBundle/Resources/config/profile.php')
        ->prefix('/profile');

    $routes->import('@FOSUserBundle/Resources/config/registration.php')
        ->prefix('/register');

    $routes->import('@FOSUserBundle/Resources/config/resetting.php')
        ->prefix('/resetting');

    $routes->import('@FOSUserBundle/Resources/config/change_password.php')
        ->prefix('/profile');
};

After

<?php
namespace Symfony\Component\Routing\Loader\Configurator;

return static function (RoutingConfigurator $routes): void {
    $routes->import('@FOSUserBundle/Resources/config/routing/security.php');

    $routes->import('@FOSUserBundle/Resources/config/routing/profile.php')
        ->prefix('/profile');

    $routes->import('@FOSUserBundle/Resources/config/routing/registration.php')
        ->prefix('/register');

    $routes->import('@FOSUserBundle/Resources/config/routing/resetting.php')
        ->prefix('/resetting');

    $routes->import('@FOSUserBundle/Resources/config/routing/change_password.php')
        ->prefix('/profile');
};

Whitout this correction, there is an error

 {closure:/var/www/vendor/friendsofsymfony/user-bundle/src/Resources/config/change_password.php:19}(): Argument #1 ($container) must be of type Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator, Sym
  fony\Component\Routing\Loader\Configurator\RoutingConfigurator given, called in /var/www/html/vendor/symfony/routing/Loader/PhpFileLoader.php on line 94

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions