# \[GELÖST \]Plugin nur laden, wenn es ein Variantenartikel ist

**URL:** https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537
**Category:** Allgemein
**Created:** [23. April 2018 um 10:07 UTC](https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537 "2018-04-23T10:07:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![coarsy](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@coarsy](https://forum.shopware.com/u/coarsy)
#### Post date: [23. April 2018 um 10:07 UTC](https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537/1 "2018-04-23T10:07:31Z")

</div>

Hi zusammen,

ich habe schon seit langem ein eigenes Plugin im Einsatz, welches plötzlich aber der 5.4 nicht mehr richtig funktioniert.

Es kommt dann der berühmte „Mein Freund der S“ Fehler…

Ich frage aktuell im Plugin folgendermaßen ab:

```
 public function onPostDispatchDetail(Enlight_Event_EventArgs $arguments)
    {
              
        /**@var $controller Shopware_Controllers_Frontend_Detail*/
        $controller = $arguments->getSubject();
        $view = $controller->View();
        
        $config = Shopware()->Plugins()->Frontend()->CbeVariantsDetail()->Config();

        $sArticle = $view->getAssign('sArticle');

        // If article has no variants, return
        if (!isset($sArticle['sConfiguratorSettings'])) {
            return;
        }               

```

Aber dennoch scheinen die Templates geladen zu werden, was den Fehler verursacht. Hat jemand eine Idee, wie man das ordentlich löst? Es handelt sich noch um das alte Pluginsystem.

Vielen Dank und liebe Grüße,

Chris

---

<div class="post-metadata">

### Author: ![coarsy](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@coarsy](https://forum.shopware.com/u/coarsy)
#### Post date: [23. April 2018 um 12:14 UTC](https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537/2 "2018-04-23T12:14:20Z")

</div>

Das ist natürlich noch die konkrete Fehlermeldung:

&nbsp;

```
 Fatal error: Uncaught SmartyCompilerException: Syntax Error in template "/html/shopware/shopwaretest/themes/Frontend/Bare/frontend/index/index.tpl" on line 7 "&lt;html class=&quot;no-js&quot; lang=&quot;{s name='IndexXmlLang'}{/s}&quot; itemscope=&quot;itemscope&quot; itemtype=&quot;http://schema.org/WebPage&quot;&gt;" unknown tag "s" in /html/shopware/shopwaretest/engine/Library/Smarty/sysplugins/smarty_internal_templatecompilerbase.php:657 Stack trace: #0 /html/shopware/shopwaretest/engine/Library/Smarty/sysplugins/smarty_internal_templatecompilerbase.php(443): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown tag "s"', 7) #1 /html/shopware/shopwaretest/engine/Library/Smarty/sysplugins/smarty_internal_templateparser.php(2388): Smarty_Internal_TemplateCompilerBase->compileTag('s', Array) #2 /html/shopware/shopwaretest/engine/Library/Smarty/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r36() in /html/shopware/shopwaretest/engine/Library/Smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 657

```

&nbsp;

---

<div class="post-metadata">

### Author: ![coarsy](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@coarsy](https://forum.shopware.com/u/coarsy)
#### Post date: [23. April 2018 um 14:42 UTC](https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537/3 "2018-04-23T14:42:14Z")

</div>

So, die konkrete Fehlermeldung lautet nun:

&nbsp;

```
Fatal error: Uncaught SmartyException: directory '/html/shopware/shopwaretest/engine/Shopware/Plugins/Community/Frontend/CbeVariantsDetail/Resources/Views/frontend/detail/index.tpl' not allowed by security setting

```

Ist also mein eigenes Plugin! Laut Updateguide ist das aber auch ein erlaubtes Verzeichnis, siehe meine Implementierung:

&nbsp;

```
        $controller->View()->addTemplateDir( __DIR__. '/Resources/Views/');
        $controller->View()->loadTemplate('frontend/index/index.tpl');
        $controller->View()->loadTemplate('frontend/detail/index.tpl');   

```

&nbsp;

---

<div class="post-metadata">

### Author: ![coarsy](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@coarsy](https://forum.shopware.com/u/coarsy)
#### Post date: [23. April 2018 um 14:55 UTC](https://forum.shopware.com/t/gelost-plugin-nur-laden-wenn-es-ein-variantenartikel-ist/52537/4 "2018-04-23T14:55:17Z")

</div>

Hat sich erledigt, ich muss das Verzeichnis vor dem RETURN bei Nichtvarianten freigeben!
