7

I upgraded my Symfony project from 4.1 to 4.2 and get this notice 12 times in profiler:

A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.

and the trace of the log is:

{▼
  /home/user/foo/bar/project/vendor/symfony/config/Definition/Builder/TreeBuilder.php:30 {▼
    › if (null === $name) {
    ›     @trigger_error('A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.', E_USER_DEPRECATED);
    › } else {
  }
  /home/user/foo/bar/project/vendor/sensio/framework-extra-bundle/DependencyInjection/Configuration.php:32 {▼
    › {
    ›     $treeBuilder = new TreeBuilder();
    ›     $rootNode = $treeBuilder->root('sensio_framework_extra', 'array');
  }
}

how to fix this?

A.Seddighi
  • 1,695
  • 1
  • 20
  • 43
  • `vendor/sensio/framework-extra-bundle/DependencyInjection/Configuration.php` needs to be updated in this way - https://github.com/symfony/symfony/pull/27476/files#diff-f79a519f22ba1864ef38a1b3468e9ed4 It is probably forgotten when this deprecation was added – Tomas Votruba Dec 07 '18 at 11:49
  • Just did an update to Symfony 4.2.1 and my 23 tree builder deprecation notices were reduced to just one: the maker-bundle. And since I don't use it I commented it out in bundles.php and viola, no more annoying depreciation notices. – Cerad Dec 07 '18 at 15:28

1 Answers1

6

The issue is already be fixed in the sensio/framework-extra-bundle: https://github.com/sensiolabs/SensioFrameworkExtraBundle/issues/593

You have to wait for the next update (higher 5.2.2).

David R
  • 76
  • 2