-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Fix casting scalar env vars from null #50517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine fixing this on 5.4 !
6277c6d
to
dafa2c4
Compare
dafa2c4
to
4212e43
Compare
4212e43
to
c4b16e5
Compare
Thank you @fancyweb. |
is this a not a BC break, or introducion of a regression? previously a env var with a default of null: parameters:
env(SOME_VAR): ~ 6.3.0: 6.3.1: |
@bendavies Can you open a new issue please with a reproducer and I'll look at it, thanks. |
…mpty string (fancyweb) This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] Fix autocasting null env values to empty string | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | - | Deprecations? | - | Tickets | #50815 (comment) | License | MIT | Doc PR | - This PR fixes autocasting `null` env values to `''`. We continue to autocast all other values to string when there's no prefix. It doesn't revert #50517, it just fixes an unintended side effect. It doesn't fix #50815 request, it confirms the behavior: the solution for this issue would be to remove the `string:` prefix. There's still no solution to have the "keep null as null" and "cast if not null" behavior. Commits ------- 2c0815d [DependencyInjection] Fix autocasting null env values to empty string
…mpty string (fancyweb) This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] Fix autocasting null env values to empty string | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | - | Deprecations? | - | Tickets | symfony/symfony#50815 (comment) | License | MIT | Doc PR | - This PR fixes autocasting `null` env values to `''`. We continue to autocast all other values to string when there's no prefix. It doesn't revert symfony/symfony#50517, it just fixes an unintended side effect. It doesn't fix symfony/symfony#50815 request, it confirms the behavior: the solution for this issue would be to remove the `string:` prefix. There's still no solution to have the "keep null as null" and "cast if not null" behavior. Commits ------- 2c0815d04e [DependencyInjection] Fix autocasting null env values to empty string
Using a casting env var processor on
null
returnsnull
(it doesn't cast) which is not what one could expect and not what is documented. We could allow it.