Skip to content

[Configuration] environment variables don't work on booleanNodes #26704

@sebastianblum

Description

@sebastianblum
Q A
Bug report? yes
Feature request? no
BC Break report? ?
RFC? no
Symfony version 4.0.6

I tried to use environment variables for booleanNodes and get this exception:

In [BooleanNode.php](github symfony/symfony boolean node) line 29:
Invalid type for path "web_profiler.intercept_redirects". Expected boolean, but got string.

To reproduce the issue, I forked symfony demo and changed this:
https://github.com/sebastianblum/demo/commit/4df780b0fcfd593d3dbdac721f5ae32ae374367e

I extended the exception and the value was:
In BooleanNode.php line 29:
Invalid type for path "web_profiler.intercept_redirects". Expected boolean, but got string. Value was: %env(bool:APP_INTERCEPT_REDIRECTS)%

It looks like that the environment variables are not correct resolved for booleanNodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions