NotFoundHttpException is thrown if no record is found in
DataAccessFunction
This commit is contained in:
@@ -26,6 +26,7 @@ namespace Thelia\Core\Template\Smarty\Plugins;
|
|||||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||||
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
|
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
use Thelia\Core\Template\Smarty\AbstractSmartyPlugin;
|
||||||
use Thelia\Core\Security\SecurityContext;
|
use Thelia\Core\Security\SecurityContext;
|
||||||
use Thelia\Core\Template\ParserContext;
|
use Thelia\Core\Template\ParserContext;
|
||||||
@@ -391,9 +392,9 @@ class DataAccessFunctions extends AbstractSmartyPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->dataAccess($objectLabel, $params, $data, $noGetterData);
|
return $this->dataAccess($objectLabel, $params, $data, $noGetterData);
|
||||||
|
} else {
|
||||||
|
throw new NotFoundHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
{* Meta *}
|
{* Meta *}
|
||||||
{block name="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}<meta name="description" content="{$META_DESCRIPTION}">{/if}
|
{if $META_DESCRIPTION}<meta name="description" content="{$META_DESCRIPTION}">{/if}
|
||||||
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
|
{if $META_KEYWORDS}<meta name="keywords" content="{$META_KEYWORDS}">{/if}
|
||||||
{/loop}
|
{/loop}
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
{* Breadcrumb *}
|
{* Breadcrumb *}
|
||||||
{block name='no-return-functions' append}
|
{block name='no-return-functions' append}
|
||||||
{$breadcrumbs = []}
|
{$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}"}
|
{loop name="category_path" type="category-path" category="{$DEFAULT_CATEGORY}"}
|
||||||
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]}
|
{$breadcrumbs[] = ['title' => {$TITLE}, 'url'=> {$URL}]}
|
||||||
{/loop}
|
{/loop}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
{* Content *}
|
{* Content *}
|
||||||
{block name="main-content"}
|
{block name="main-content"}
|
||||||
<div class="main">
|
<div class="main">
|
||||||
{loop name="product.details" type="product" id="{product attr="id"}"}
|
{loop name="product.details" type="product" id="{product attr="id"}" limit="1"}
|
||||||
<article id="product" class="col-main" role="main" itemscope itemtype="http://schema.org/Product">
|
<article id="product" class="col-main" role="main" itemscope itemtype="http://schema.org/Product">
|
||||||
|
|
||||||
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
|
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
|
||||||
|
|||||||
Reference in New Issue
Block a user