Description
Symfony version(s) affected: >=3.4.37
Description
The following error might appear which blocks Debug Toolbar to be loaded:
Uncaught PHP Exception ErrorException: "Notice: Undefined index: errorCount" at /Users/torinaki/www/htdocs/fithealthy2/vendor/symfony/http-kernel/DataCollector/LoggerDataCollector.php line 190
How to reproduce
TBD
@trigger_error("1", E_USER_DEPRECATED)
Such a log message might be thrown by:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Config/Definition/ArrayNode.php#L238
in case if configuration child is deprecated and depreciation message for some reason is "1"
Possible Solution
Fix logic of:
- There no guarantee that "errorCount" exists but it is not a root cause.
$sanitizedLogs
contains numeric and assoc. keys. It should be avoided:
Additional Context
It happened because of incorrect passed deprecation message:
https://github.com/Sylius/SyliusMailerBundle/blob/1.4/src/Bundle/DependencyInjection/Configuration.php#L76
It was possible because of missing type hint:
https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Config/Definition/BaseNode.php#L170
which is fixed in 5.0 version of Symfony:
https://github.com/symfony/symfony/blob/5.0/src/Symfony/Component/Config/Definition/BaseNode.php#L204