Skip to content

fix #10054 - form data collector with dynamic fields #13027

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

Closed
wants to merge 1 commit into from

Conversation

zulus
Copy link
Contributor

@zulus zulus commented Dec 18, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #10054
License MIT
Doc PR -

This simple patch will fix webprofiler bug with collection field.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#10054
| License       | MIT
| Doc PR        | -
@fabpot
Copy link
Member

fabpot commented Dec 21, 2014

Just tested with the steps described here: #11474 (comment) and I confirm that this fixes the issue.

@fabpot
Copy link
Member

fabpot commented Dec 21, 2014

Note to myself: this should be merged in 2.5.

@fabpot
Copy link
Member

fabpot commented Dec 21, 2014

@zulus Can you add a unit test to ensure that we don't have a regression in the future? Thanks.

@zulus
Copy link
Contributor Author

zulus commented Dec 21, 2014

@fabpot Off course. I also can close this pull request and prepare for 2.5 with tests.

@sergionegri
Copy link

I think I have a similar issue with Symfony 2.6.1. I created a form (which works perfectly) but when I call the profiler I get:

Key "type" for array with keys "id, name, view_vars, children" does not exist in @WebProfiler/Collector/form.html.twig at line 423

Will the fix also be merged in 2.6.1?

The only thing I don't have the allow_add enabled :/

@fabpot
Copy link
Member

fabpot commented Dec 29, 2014

Thank you @zulus.

fabpot added a commit that referenced this pull request Dec 29, 2014
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #13027).

Discussion
----------

fix #10054 - form data collector with dynamic fields

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10054
| License       | MIT
| Doc PR        | -

This simple patch will fix webprofiler bug with collection field.

Commits
-------

cffb64f fix #10054 - form data collector with dynamic fields
@fabpot
Copy link
Member

fabpot commented Dec 29, 2014

@zulus I've merged your PR in the 2.5 branch. Can you open a new PR on 2.5 to add some unit tests? Thanks.

@fabpot fabpot closed this Dec 29, 2014
@wouterj
Copy link
Member

wouterj commented Dec 29, 2014

Awesome, thank you very much @zulus for fixing this issue!

@fabpot
Copy link
Member

fabpot commented Dec 29, 2014

@zulus Can you have a look at the tests; they are actually broken because of this PR:

phpunit src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataCollectorTest.php
PHPUnit 4.3.5 by Sebastian Bergmann.

Configuration read from phpunit.xml.dist

........E

Time: 146 ms, Memory: 5.00Mb

There was 1 error:

1) Symfony\Component\Form\Tests\Extension\DataCollector\FormDataCollectorTest::testCollectSubmittedDataCountsErrors
array_replace(): Argument #2 is not an array

src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php:106
src/Symfony/Component/Form/Extension/DataCollector/FormDataCollector.php:143
src/Symfony/Component/Form/Tests/Extension/DataCollector/FormDataCollectorTest.php:514

zulus added a commit to zulus/symfony that referenced this pull request Dec 29, 2014
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -
@zulus
Copy link
Contributor Author

zulus commented Dec 29, 2014

@fabpot PR #13151 fixes regression

@xabbuh
Copy link
Member

xabbuh commented Dec 29, 2014

@sergionegri Has your issue been fixed with the latest 2.5-dev version? Or can you confirm that #13155 is the same as your issue?

fabpot added a commit that referenced this pull request Dec 30, 2014
This PR was merged into the 2.5 branch.

Discussion
----------

fix regression in form tests after pr #13027

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

1121064 fix regression in form tests after pr #13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
fabpot added a commit that referenced this pull request Dec 30, 2014
* 2.5:
  Updated generateSql tool
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr #13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix #10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  [DomCrawler] fixed bug #12143

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php
	src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php
fabpot added a commit that referenced this pull request Dec 30, 2014
* 2.6: (21 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr #13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix #10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  Fix wrong DateTransformer timezone param for non-UTC configuration. #12808
  [Form] Add further timezone tests for date type
  ...

Conflicts:
	src/Symfony/Component/Locale/Locale.php
	src/Symfony/Component/Locale/composer.json
fabpot added a commit that referenced this pull request Dec 30, 2014
* 2.7: (26 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  Updated the SQL data generated from the generateSql tool
  Updated generateSql tool
  fix regression in form tests after pr #13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  [FrameworkBundle] added a test router for the buil-in web server
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix #10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  [2.7] Allow 3.0 requirements
  ...
@sergionegri
Copy link

@xabbuh I'm new to github and the way to properly interact with the community, so please excuse me in advance if my approach is not right. I'm running v2.7.0 now and the problem persists. Should it be fixed? I see the pull requests for 2.7 also, but don't know if they are implemented already or not.

@xabbuh
Copy link
Member

xabbuh commented Dec 30, 2014

@sergionegri There was no new release since the issue has been fixed. This mean that you would at least have to use the latest development version to check. Though I think that this won't solve your problem since your error message is the same as the one in #13155. Fortunately, there is already a proposed fix for this (see #13166) which should resolve your issue.

@wouterj
Copy link
Member

wouterj commented Dec 30, 2014

Btw, basing on 2.7 is not a very good decision. It's still in early-development. You should try out 2.6.

@sergionegri
Copy link

I'll wait for the next update then. I was on 2.6.1 but running "composer update" it upgraded to 2.7. How can I tell it to upgrade to any 2.6.X but not 2.7.X?

@zulus zulus deleted the bug_10054 branch December 30, 2014 11:08
@wouterj
Copy link
Member

wouterj commented Dec 30, 2014

Make sure to have "minimum-stability": "stable" in your composer.json

@sergionegri
Copy link

Sorry, I confirm I still run 2.6.1. Running the last "composer update" I saw a "(v2.7.0)" and assumed it was Symfony, but actually it was the symfony/monolog-bundle. I also checked and the "stable" option should be the default one, so I should be ok. As soon as it gets fixed in a stable version I'll let you know if it gets fixed.

@zulus
Copy link
Contributor Author

zulus commented Dec 30, 2014

@sergionegri If you want test latest 2.6 snapshot, replace:

"symfony/symfony" : "2.6.*"

with

"symfony/symfony" : "2.6.*@dev"

in your composer.json and run composer.phar update symfony/symfony

ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 2.5:
  Updated generateSql tool
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  [DomCrawler] fixed bug symfony#12143

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php
	src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 2.6: (21 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  Fix wrong DateTransformer timezone param for non-UTC configuration. symfony#12808
  [Form] Add further timezone tests for date type
  ...

Conflicts:
	src/Symfony/Component/Locale/Locale.php
	src/Symfony/Component/Locale/composer.json
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 2.7: (26 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  Updated the SQL data generated from the generateSql tool
  Updated generateSql tool
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  [FrameworkBundle] added a test router for the buil-in web server
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  [2.7] Allow 3.0 requirements
  ...
jderusse pushed a commit to jderusse/symfony that referenced this pull request Dec 15, 2020
* 2.5:
  Updated generateSql tool
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  [DomCrawler] fixed bug symfony#12143

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php
	src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php
jderusse pushed a commit to jderusse/symfony that referenced this pull request Dec 15, 2020
* 2.6: (21 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  Update the note about origins of the CssSelector component.
  Use the correct cssselect library name in docblocks.
  Fix wrong DateTransformer timezone param for non-UTC configuration. symfony#12808
  [Form] Add further timezone tests for date type
  ...

Conflicts:
	src/Symfony/Component/Locale/Locale.php
	src/Symfony/Component/Locale/composer.json
jderusse pushed a commit to jderusse/symfony that referenced this pull request Dec 15, 2020
* 2.7: (26 commits)
  Updated generateSql tool
  Fix grammar
  Fix the implementation of deprecated Locale classes
  Fix phpdoc and coding standards
  Replace usages of the deprecated TypeTestCase by the new one
  Remove usages of deprecated constants
  Update functional tests to use the PSR NullLogger
  Updated the SQL data generated from the generateSql tool
  Updated generateSql tool
  fix regression in form tests after pr symfony#13027 | Q             | A | ------------- | --- | Bug fix?      | yes | New feature?  | no | BC breaks?    | no | Deprecations? | no | Tests pass?   | yes | Fixed tickets | - | License       | MIT | Doc PR        | -
  [FrameworkBundle] added a test router for the buil-in web server
  Make fabbot happy
  Clean up testing
  No global state for isolated tests and other fixes
  No global state for isolated tests and other fixes
  fix symfony#10054 - form data collector with dynamic fields
  [TwigBundle] Moved the setting of the default escaping strategy from the Twig engine to the Twig environment
  [Debug] fix checkip6
  [HttpFoundation] fixed error when an IP in the X-Forwarded-For HTTP header contains a port
  [2.7] Allow 3.0 requirements
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants