Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.4fromfancyweb:di/cast-null-env-p
Jun 1, 2023

Conversation

@fancyweb
Copy link
Contributor

@fancywebfancyweb commentedMay 31, 2023
edited
Loading

QA
Branch?5.4
Bug fix?yes
New feature?no
Deprecations?-
Tickets#50415
LicenseMIT
Doc PR-

Using a casting env var processor onnull returnsnull (it doesn't cast) which is not what one could expect and not what is documented. We could allow it.

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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 !

@fancywebfancyweb changed the base branch from6.3 to5.4June 1, 2023 07:16
@fancywebfancyweb modified the milestones:6.3,5.4Jun 1, 2023
@fancywebfancyweb added the Bug labelJun 1, 2023
@nicolas-grekasnicolas-grekas changed the title[DependencyInjection] Allow casting env var processors to cast null[DependencyInjection] Fix casting scalar env vars from nullJun 1, 2023
@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commit091ac2b intosymfony:5.4Jun 1, 2023
@fancywebfancyweb deleted the di/cast-null-env-p branchJune 1, 2023 08:17
This was referencedJun 26, 2023
@bendavies
Copy link
Contributor

bendavies commentedJun 27, 2023
edited
Loading

is this a not a BC break, or introducion of a regression?
or neither because it's not what is documented?

previously a env var with a default of null:

parameters:env(SOME_VAR):~

6.3.0:
'%env(SOME_VAR)%' will returnnull

6.3.1:
'%env(SOME_VAR)%' will return'' (empty string)

Guilain, fmarchalemisys, and BafS reacted with thumbs up emoji

@fancyweb
Copy link
ContributorAuthor

fancyweb commentedJun 28, 2023
edited
Loading

@bendavies Can you open a new issue please with a reproducer and I'll look at it, thanks.

nicolas-grekas added a commit that referenced this pull requestJul 3, 2023
…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'tfix#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
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull requestJul 3, 2023
…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 revertsymfony/symfony#50517, it just fixes an unintended side effect.It doesn'tfixsymfony/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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.4

Development

Successfully merging this pull request may close these issues.

4 participants

@fancyweb@nicolas-grekas@bendavies@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp