View Issue Details

IDProjectCategoryView StatusLast Update
0007572OXID eShop (all versions)2.3. Extensions (modules, themes)public2025-04-02 15:16
Reportermichael_keiluweit Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Product Version7.0.0 
Summary0007572: Wrong Exception Message in case of a twig error
DescriptionThe exception message for an error within a template states, that the template was not found:
OXID Logger.ERROR: Template "@moduletemplate/foobar-template" nicht gefunden ["[object] (Twig\\Error\\SyntaxError(code: 0): Unknown \"sad\" tag. at /var/www/html/packages/oxs-test/moduletemplate/views/twig/foobar-template.html.twig:3
In this case the template was loaded successfully, then a error producing twig command was installed purposefully and after that, the misleading exception was thrown.
Steps To Reproduce1. Install v7 (use twig as template engine)
2. install a module with a controller, rendering a twig template
3. make sure it works perfectly
4. add a broken twig command like {% asd %}
5. make sure the module is installed with the latest changes
6. call the controller and have a look into the log file oxideshop.log
Additional Information
[2023-12-20 08:38:03] OXID Logger.ERROR: Template "@moduletemplate/foobar-template" nicht gefunden ["[object] (Twig\\Error\\SyntaxError(code: 0): Unknown \"sad\" tag. at /var/www/html/packages/oxs-test/moduletemplate/views/twig/foobar-template.html.twig:3)\n[stacktrace]\n#0 /var/www/html/vendor/twig/twig/src/Parser.php(83): Twig\\Parser->subparse(NULL, false)\n#1 /var/www/html/vendor/twig/twig/src/Environment.php(488): Twig\\Parser->parse(Object(Twig\\TokenStream))\n#2 /var/www/html/vendor/twig/twig/src/Environment.php(516): Twig\\Environment->parse(Object(Twig\\TokenStream))\n#3 /var/www/html/vendor/twig/twig/src/Environment.php(348): Twig\\Environment->compileSource(Object(Twig\\Source))\n#4 /var/www/html/vendor/twig/twig/src/Environment.php(309): Twig\\Environment->loadTemplate('__TwigTemplate_...', '@moduletemplate...')\n#5 /var/www/html/vendor/twig/twig/src/Environment.php(277): Twig\\Environment->load('@moduletemplate...')\n#6 /var/www/html/vendor/oxid-esales/twig-component/src/TwigEngine.php(54): Twig\\Environment->render('@moduletemplate...', Array)\n#7 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Internal/Framework/Templating/TemplateRenderer.php(32): OxidEsales\\Twig\\TwigEngine->render('@moduletemplate...', Array)\n#8 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(435): OxidEsales\\EshopCommunity\\Internal\\Framework\\Templating\\TemplateRenderer->renderTemplate('@moduletemplate...', Array)\n#9 /var/www/html/vendor/oxid-esales/oxideshop-ee/Core/ShopControl.php(201): OxidEsales\\EshopCommunity\\Core\\ShopControl->render(Object(OxidSupport\\ModuleTemplate\\Controller\\Foobar))\n#10 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(316): OxidEsales\\EshopEnterprise\\Core\\ShopControl->render(Object(OxidSupport\\ModuleTemplate\\Controller\\Foobar))\n#11 /var/www/html/vendor/oxid-esales/oxideshop-ee/Core/ShopControl.php(91): OxidEsales\\EshopCommunity\\Core\\ShopControl->formOutput(Object(OxidSupport\\ModuleTemplate\\Controller\\Foobar))\n#12 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(240): OxidEsales\\EshopEnterprise\\Core\\ShopControl->formOutput(Object(OxidSupport\\ModuleTemplate\\Controller\\Foobar))\n#13 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(123): OxidEsales\\EshopCommunity\\Core\\ShopControl->process('OxidSupport\\\\Module...', NULL, NULL, NULL)\n#14 /var/www/html/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#15 /var/www/html/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#16 {main}\n"] []
TagsNo tags attached.
ThemeAll
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Relationships

has duplicate 0007678 closedmichael_keiluweit Template render error always says template not found 

Activities

QA

2023-12-20 14:30

administrator   ~0016089

Acknowledged. I was able to reproduce it.

AF

SvenBrunk

2025-04-02 15:16

administrator   ~0017897

This is probably just something you need to get used to.
From the perspective of the twig renderer the template was not found. That is the rendered output that could not be generated because of the parse error.
The actual cause is visible in the trace though.