Skip to content

[HttpKernel] All registered extensions are always (wrongly) loaded #26512

@ManInTheBox

Description

@ManInTheBox
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4.5

I believe that #25914 introduced a BC break.

Previously, we wanted to ensure that only certain extensions are loaded, but not all of them. In particular, I'm referring to the extensions provided by the bundles themselves. However, new behavior introduced in #25914 assumes that we want to implicitly load all of them. That is wrong because we want to load only enabled extensions.

For example one could do $container->registerExtension($extension) but the extension wouldn't be actually loaded unless some configuration is processed that triggers extension loading e.g. my_extension: ~ or other similar ways to do the same thing.

I noticed this bug in my application where having a single bundle I register several different extensions but load only a few of them based on different environments. Suddenly, with this new BC break, no conditional loading worked anymore - all of the registered extensions were loaded!

Please let me know what you think. I could provide a patch if you agree this is unwanted behavior. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions