This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 5859703be4 bug #23050 [Form][Profiler] Fixes form collector triggering deprecations (ogizanagi)
This PR was merged into the 3.3 branch.

Discussion
----------

[Form][Profiler] Fixes form collector triggering deprecations

| Q             | A
| ------------- | ---
| Branch?       | 3.3 <!-- see comment below -->
| Bug fix?      | yes
| New feature?  | no <!-- don't forget updating src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget updating UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

Since 3.3, if you inspect your logs when accessing the form profiler panel, you'll see some of these:

```sh
php.INFO: User Deprecated: The Symfony\Bundle\WebProfilerBundle\Twig\WebProfilerExtension::dumpValue() method is deprecated since version 3.2 and will be removed in 4.0.
[...] at /src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php:119
```

The [WebProfilerExtension](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php#L73) is still using a `ValueExporter` instance for BC reasons when the $value ins't an instance of `Data` and this BC layer will be removed in 4.0 (so it'll throw an exception/error when trying to use it with something else than a `Data` instance).

The issue is since #21638, collectors (including forms one) have been drastically simplified to leverage the "seamless usage of Data clones", which is great!... But there is a slightly different implementation between `Data::seek()` and [`Data::__get()`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Cloner/Data.php#L123-L130). There are probably good reasons for this, but it prevents from using classic Twig property access when the underlying data may be a scalar (`null`, `false`, ...).

I already spot that while working on the [Validator panel](https://github.com/symfony/symfony/pull/22554/files#diff-deac3c5ce4aa87243093dcd6a3f77a56R84). Perhaps there is a better solution, though.

Anyway, current `master` is currently broken, as it still tries to use the `ValueExporter`, which is already removed. And removing the BC layer in `WebProfilerExtension` isn't enough for now. It needs this fix.

BTW it also fixes rendering of the concerned inlined-dumps:

|Before|After|
|--|--|
|<img width="818" alt="screenshot 2017-06-03 a 13 35 25" src="https://cloud.githubusercontent.com/assets/2211145/26753222/01a692e6-4862-11e7-90d5-9cc9e4832648.PNG">|<img width="817" alt="screenshot 2017-06-03 a 13 35 47" src="https://cloud.githubusercontent.com/assets/2211145/26753224/090d5d6c-4862-11e7-87c1-73d5346f602c.PNG">|

Commits
-------

9de898d69f [Form][Profiler] Fixes form collector triggering deprecations
2017-06-03 09:03:25 -07:00
.composer Drop hirak/prestissimo 2016-05-12 07:44:15 -05:00
.github Using FQ name for PHP_VERSION_ID 2017-06-01 13:44:56 -07:00
src/Symfony bug #23050 [Form][Profiler] Fixes form collector triggering deprecations (ogizanagi) 2017-06-03 09:03:25 -07:00
.editorconfig Add EditorConfig File 2012-06-16 14:08:15 +02:00
.gitignore Add appveyor.yml for C.I. on Windows 2015-08-25 23:41:37 +02:00
.php_cs.dist [Asset] Adding a new version strategy that reads from a manifest JSON file 2017-03-25 09:22:50 -07:00
.travis.yml Merge branch '3.2' into 3.3 2017-05-19 14:13:17 +02:00
appveyor.yml Merge branch '2.8' into 3.2 2017-05-19 14:10:04 +02:00
CHANGELOG-3.0.md Merge branch '2.8' into 3.1 2016-08-05 10:37:39 +02:00
CHANGELOG-3.1.md updated CHANGELOG for 3.1.9 2017-01-12 12:43:31 -08:00
CHANGELOG-3.2.md updated CHANGELOG for 3.2.9 2017-05-29 12:31:58 -07:00
CHANGELOG-3.3.md updated CHANGELOG for 3.3.0 2017-05-29 13:36:48 -07:00
composer.json Merge branch '3.2' into 3.3 2017-06-02 10:55:39 +02:00
CONTRIBUTING.md Mention the community review guide 2016-12-18 22:02:35 +01:00
CONTRIBUTORS.md Merge branch '2.8' into 3.2 2017-06-01 14:00:24 -07:00
LICENSE updated LICENSE year 2017-01-02 12:30:00 -08:00
phpunit Using FQ name for PHP_VERSION_ID 2017-06-01 13:44:56 -07:00
phpunit.xml.dist Merge branch '3.2' 2017-04-12 07:14:56 -07:00
README.md Fix minor typo in the main README.md 2017-04-27 20:23:38 +02:00
UPGRADE-3.0.md Fixed formatting in Security section 2017-04-14 11:38:02 +02:00
UPGRADE-3.1.md [Serializer] Remove AbstractObjectNormalizer::isAttributeToNormalize 2016-12-08 16:02:32 +01:00
UPGRADE-3.2.md [DI] Check for privates before shared services 2017-05-23 19:58:02 +02:00
UPGRADE-3.3.md [Di] Remove closure-proxy arguments 2017-06-01 22:59:07 +02:00
UPGRADE-4.0.md [Di] Remove closure-proxy arguments 2017-06-01 22:59:07 +02:00

Symfony is a PHP framework for web applications and a set of reusable PHP components. Symfony is used by thousands of web applications (including BlaBlaCar.com and Spotify.com) and most of the popular PHP projects (including Drupal and Magento).

Installation

Documentation

Community

Contributing

Symfony is an Open Source, community-driven project with thousands of contributors. Join them contributing code or contributing documentation.

Security Issues

If you discover a security vulnerability within Symfony, please follow our disclosure procedure.

About Us

Symfony development is sponsored by SensioLabs, led by the Symfony Core Team and supported by Symfony contributors.