PHP Version
8.2
Shopware Version
6.6.10.15
Plugin Version
3.0.1
Actual behaviour
I ran into the following error:
{
"errors": [
{
"code": "0",
"status": "500",
"title": "Internal Server Error",
"detail": "An exception has been thrown during the rendering of a template (\"Frosh\\DevelopmentHelper\\Component\\Profiler\\TwigDataCollector::getTemplateData(): Return value must be of type array, null returned\") in \"@FroshDevelopmentHelper/Collector/twig.html.twig\" at line 112.",
"meta": {
"trace": [ ... ]
}
}
]
}
Here's the full error trace: 500.json
The issue is that TwigDataCollector::getTemplateData() has to return an array
|
public function getTemplateData(): array |
|
{ |
|
return $this->data['renders']; |
|
} |
but for whatever reasons returns
null. Patched this locally simply with
return $this->data['renders'] ?? [];
what seems to work fine.
Expected behaviour
No 500 error :)
Steps to Reproduce?
Not sure ... I can reproduce it with lots of plugins installed, but likely not reproducible on a plain Shopware instance.
Happens in my case when opening the Twig tab in the Symfony profiler toolbar (Composer package symfony/web-profiler-bundle, example route /_profiler/29e7a3?panel=twig).
PHP Version
8.2
Shopware Version
6.6.10.15
Plugin Version
3.0.1
Actual behaviour
I ran into the following error:
{ "errors": [ { "code": "0", "status": "500", "title": "Internal Server Error", "detail": "An exception has been thrown during the rendering of a template (\"Frosh\\DevelopmentHelper\\Component\\Profiler\\TwigDataCollector::getTemplateData(): Return value must be of type array, null returned\") in \"@FroshDevelopmentHelper/Collector/twig.html.twig\" at line 112.", "meta": { "trace": [ ... ] } } ] }Here's the full error trace: 500.json
The issue is that
TwigDataCollector::getTemplateData()has to return anarrayFroshDevelopmentHelper/src/Component/Profiler/TwigDataCollector.php
Lines 16 to 19 in f4151a2
but for whatever reasons returns
null. Patched this locally simply withwhat seems to work fine.
Expected behaviour
No 500 error :)
Steps to Reproduce?
Not sure ... I can reproduce it with lots of plugins installed, but likely not reproducible on a plain Shopware instance.
Happens in my case when opening the Twig tab in the Symfony profiler toolbar (Composer package
symfony/web-profiler-bundle, example route/_profiler/29e7a3?panel=twig).