ezsystems/ezpublish-kernel — pull request #714 by jeromegamez (2014-02-04 13:30:16+00:00)
Title: EZP-22290: Avoid PHP notice because of uninitialized variable

In `TemplateDebugInfo::getLegacyTemplatesList` a PHP Notice is generated when the usage statistics can not be retrieved thus leaving `$templateStats` uninitialized.

```php
try
{
$templateStats = $legacyKernel()->runCallback(
function ()
{
return eZTemplate::templatesUsageStatistics();
}
);
}
catch ( RuntimeException $e )
{
// Ignore the exception thrown by legacy kernel as this would break debug toolbar (and thus debug info display).
// Furthermore, some legacy kernel handlers don't support runCallback (e.g. ezpKernelTreeMenu)
}

foreach ( $templateStats as $tplInfo )
{
// ...
}
```

This PR adds the variable declaration in the `catch` block.

https://jira.ez.no/browse/EZP-22290

Cheers
:octocat: Jérôme