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

Enableable ArrayNodeDefinition is disabled for empty configuration#25789

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

Closed
mateuszsip wants to merge4 commits intosymfony:2.7frommateuszsip:fix/25760

Conversation

@mateuszsip
Copy link
Contributor

QA
Branch?2.7+
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#25760
LicenseMIT

Fixes#25760.

Currently, documented behavior is not true:

* By default, the section is disabled. If any configuration is specified then
* the node will be automatically enabled:

@mateuszsipmateuszsip changed the base branch frommaster to2.7January 15, 2018 00:53
->then(function ($v) {
$v['enabled'] =isset($v['enabled']) ?$v['enabled'] :true;
if (!isset($v['enabled'])) {
$v['enabled'] =empty($v) ?false :true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can also be written as$v['enabled'] = !empty($v);

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

damn, you're right :D

@xabbuhxabbuh added this to the2.7 milestoneJan 15, 2018
Copy link
Contributor

@SimperfitSimperfit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The tests failure seems unrelated to the current PR.

@fabpot
Copy link
Member

Thank you @kejwmen.

fabpot added a commit that referenced this pull requestJan 17, 2018
…guration (kejwmen)This PR was squashed before being merged into the 2.7 branch (closes#25789).Discussion---------- Enableable ArrayNodeDefinition is disabled for empty configuration| Q             | A| ------------- | ---| Branch?       | 2.7+| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#25760| License       | MITFixes#25760.Currently, documented behavior is not true:https://github.com/symfony/symfony/blob/70c8c2d47bd71861c8205985a17e68cedf828e1f/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php#L207-L208Commits-------a6a330d  Enableable ArrayNodeDefinition is disabled for empty configuration
@fabpotfabpot closed thisJan 17, 2018
xabbuh added a commit to xabbuh/symfony that referenced this pull requestJan 19, 2018
The failing tests relied on the assets integration being enabled. Sincewe never did enable this explicitly, the assets related definitions areremoved now thatsymfony#25789 was merged whichfixedsymfony#25760.
chalasr added a commit that referenced this pull requestJan 19, 2018
This PR was merged into the 3.3 branch.Discussion----------[FrameworkBundle] fix DI extension tests| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |The failing tests relied on the assets integration being enabled. Sincewe never did enable this explicitly, the assets related definitions areremoved now that#25789 was merged whichfixed#25760.Commits-------1cb8f69 [FrameworkBundle] fix DI extension tests
@fabpot
Copy link
Member

reverted because of#25862 (9312f79)

fabpot added a commit that referenced this pull requestJan 21, 2018
…ty configuration (kejwmen)"This reverts commit132cec4, reversingchanges made tod411301.
->then(function ($v) {
$v['enabled'] =isset($v['enabled']) ?$v['enabled'] :true;
if (!isset($v['enabled'])) {
$v['enabled'] = !empty($v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should probably beis_array($v) && !empty($v) to cover thefoo: ~ case, which should work as enable.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What tests should we add to make sure it won't happen in the future? Component tests covernull case already.~ is just anull, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

forget my comment. This callback is only triggered for arrays ;)

Copy link
ContributorAuthor

@mateuszsipmateuszsipJan 21, 2018
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks like~ in yaml is represented by empty array (?), simple reproducer is availablehere

nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
* 2.7:  [HttpFoundation] fixed return type of method HeaderBag::get  [HttpFoundation] Added "resource" type on Request::create docblock  Revert "bug#25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"  Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"  [Validator] add missing parent isset and add test
nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
* 2.8:  [HttpFoundation] fixed return type of method HeaderBag::get  [HttpFoundation] Added "resource" type on Request::create docblock  Revert "bug#25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"  Formatting fix in upgrade 3.0 document  Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"  [Validator] add missing parent isset and add test
nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
* 3.3:  Have weak_vendors ignore deprecations from outside  [HttpFoundation] fixed return type of method HeaderBag::get  [HttpFoundation] Added "resource" type on Request::create docblock  [Process] Skip environment variables with false value in Process  Revert "bug#25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"  Formatting fix in upgrade 3.0 document  don't split lines on carriage returns when dumping  Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"  [DI] compilation perf tweak  [Validator] Conflict with egulias/email-validator 2.0  [Validator] add missing parent isset and add test
nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
* 3.4:  Have weak_vendors ignore deprecations from outside  [HttpFoundation] fixed return type of method HeaderBag::get  [HttpFoundation] Added "resource" type on Request::create docblock  [Process] Skip environment variables with false value in Process  Revert "bug#25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"  Formatting fix in upgrade 3.0 document  don't split lines on carriage returns when dumping  Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"  [DI] compilation perf tweak  [Validator] Conflict with egulias/email-validator 2.0  [Validator] add missing parent isset and add test
nicolas-grekas added a commit that referenced this pull requestJan 21, 2018
* 4.0:  Have weak_vendors ignore deprecations from outside  [HttpFoundation] fixed return type of method HeaderBag::get  [HttpFoundation] Added "resource" type on Request::create docblock  [Console] Fix using finally where the catch can also fail  [Process] Skip environment variables with false value in Process  Revert "bug#25789  Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)"  Formatting fix in upgrade 3.0 document  don't split lines on carriage returns when dumping  trim spaces from unquoted scalar values  Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)"  [DI] compilation perf tweak  [Validator] Conflict with egulias/email-validator 2.0  [Validator] add missing parent isset and add test
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

+3 more reviewers

@jakzaljakzaljakzal left review comments

@linaorilinaorilinaori left review comments

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

2.7

Development

Successfully merging this pull request may close these issues.

7 participants

@mateuszsip@fabpot@jakzal@linaori@xabbuh@Simperfit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp