Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The configuration of packages in the application is ignored after they are applied inside prependExtension the bundle #54840

Closed
@tebaly

Description

@tebaly

Symfony version(s) affected

6.4,7

Description

use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

class SomeBundle extends AbstractBundle
{
// ...
    public function prependExtension(ContainerConfigurator $container, ContainerBuilder $builder): void
    {
        $container->import('../config/packages/vich_uploader.yaml');

After this, any changes to the root of the application in which the bundle is installed are ignored. Although it is declared that the settings in ../config/packages in the application should overwrite all changes made by the bundle.

After commenting the lines $container->import('. inside the bundle, the application settings are made as expected

How to reproduce

Combine public function prependExtension and $container->import('../config/packages/...);

Possible Solution

No response

Additional Context

Perhaps this is related specifically to vich_uploader

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