Hallo Leute,
wenn wir bei uns im Shop die Suche auf eine Kategorie beschränken wollen, bekommen wir einen Fehler.
Also genau dann wenn man in die Suche etwas eingibt und dann ncoh eine Checkbox anhakt, kommt folgender Fehler:
Fatal error : Call to a member function getLabel() on null in /var/cache/production_xyz/templates/frontend_ xyz** _de_DE_1_secure/6a/cb/42/fdgregfgdfg.snippet.index.tpl.php on line 2101**
503 Service Unavailable
Ich habe mir das genauer angesehen und dieser CodeBlock wird angekreidet (im Detail der fett markierte):
<?php if ($_smarty_tpl->tpl\_vars['level']-\>value==0){?\> <?php ob_start();?><?php $_smarty_tpl->smarty-\>\_tag\_stack[] = array('snippet', array('name'=\>"SearchFilterMainCategories",'namespace'=\>'frontend/search/filter\_category')); $\_block\_repeat=true; echo Enlight\_Components\_Snippet\_Resource::compileSnippetBlock(array('name'=\>"SearchFilterMainCategories",'namespace'=\>'frontend/search/filter\_category'), null, $\_smarty\_tpl, $\_block\_repeat);while ($\_block\_repeat) { ob\_start();?\> <?php echo "Hauptkategorien";?><?php $_block_content = ob_get_clean(); $_block_repeat=false; echo Enlight_Components_Snippet_Resource::compileSnippetBlock(array('name'=>"SearchFilterMainCategories",'namespace'=\>'frontend/search/filter\_category'), $\_block\_content, $\_smarty\_tpl, $\_block\_repeat); } array\_pop($\_smarty\_tpl-\>smarty-\>\_tag\_stack);?\> <?php $_tmp1=ob_get_clean();?><?php $_smarty_tpl->createLocalArrayVariable('activeCategoryTree', null, 0);\_smarty\_tpl-\>tpl\_vars['activeCategoryTree']-\>value[] = array('label'=\>_tmp1,‘link’=>’#?c=reset’);?>
<?php }else{ ?>
<?php _smarty_tpl->createLocalArrayVariable('activeCategoryTree', null, 0);
**_smarty_tpl->tpl_vars[‘activeCategoryTree’]->value = array(‘label’=>((string)\_smarty\_tpl-\>tpl\_vars['category']-\>value-\>getLabel()),'link'=\>"#?c=".((string)_smarty_tpl->tpl_vars[‘category’]->value->getId()));?>**
<?php }?>
Im Shopware-Demoshop klappt das jedoch alles. Habt ihr vielleicht Ideen dazu?
Gruß Yuri