diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index c6119811a..a13248d09 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -26,6 +26,7 @@ namespace Thelia\Core\Template\Smarty\Plugins; use Propel\Runtime\ActiveQuery\ModelCriteria; use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Thelia\Core\Template\Smarty\AbstractSmartyPlugin; use Thelia\Core\Security\SecurityContext; use Thelia\Core\Template\ParserContext; @@ -391,9 +392,9 @@ class DataAccessFunctions extends AbstractSmartyPlugin } return $this->dataAccess($objectLabel, $params, $data, $noGetterData); + } else { + throw new NotFoundHttpException(); } - - return ''; } /** diff --git a/templates/frontOffice/default/product.html b/templates/frontOffice/default/product.html index 99f897920..2d11498e8 100644 --- a/templates/frontOffice/default/product.html +++ b/templates/frontOffice/default/product.html @@ -12,7 +12,7 @@ {* Meta *} {block name="meta"} - {loop name="product.seo.meta" type="product" id="{product attr="id"}"} + {loop name="product.seo.meta" type="product" id="{product attr="id"}" limit="1"} {if $META_DESCRIPTION}{/if} {if $META_KEYWORDS}{/if} {/loop} @@ -21,7 +21,7 @@ {* Breadcrumb *} {block name='no-return-functions' append} {$breadcrumbs = []} - {loop type="product" name="product_breadcrumb" id="{product attr="id"}"} + {loop type="product" name="product_breadcrumb" id="{product attr="id"}" limit="1"} {loop name="category_path" type="category-path" category="{$DEFAULT_CATEGORY}"} {$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]} {/loop} @@ -32,7 +32,7 @@ {* Content *} {block name="main-content"}