$product = $this->productRepository
->search($criteria, $context)
->first();
if (!$product instanceof SalesChannelProductEntity) {
throw new ProductNotFoundException($productId);
}
$product->setSeoCategory(
$this->breadcrumbBuilder->getProductSeoCategory($product, $context)
);
try {
foreach (self::$profilers as $profiler) {
$profiler->start($name, $category, $tags);
}
$result = $closure();
} finally {
foreach (self::$profilers as $profiler) {
$profiler->stop($name);
}
}
$product->setCmsPage($page);
}
}
return new ProductDetailRouteResponse($product, $configurator);
});
}
private function addFilters(SalesChannelContext $context, Criteria $criteria): void
{
$criteria->addFilter(
$value = $this->cache->get($key, function (ItemInterface $item) use ($productId, $request, $context, $criteria) {
$name = self::buildName($productId);
$response = $this->tracer->trace($name, function () use ($productId, $request, $context, $criteria) {
return $this->getDecorated()->load($productId, $request, $context, $criteria);
});
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
$this->decoratedSystemConfigService->deleteExtensionConfiguration($extensionName, $config);
}
public function trace(string $key, Closure $param)
{
return $this->decoratedSystemConfigService->trace($key, $param);
}
public function getTrace(string $key): array
{
return $this->decoratedSystemConfigService->getTrace($key);
*/
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, function () use ($key, $param) {
return $this->translator->trace($key, function () use ($key, $param) {
return $this->config->trace($key, $param);
});
});
}
public function get(string $key): array
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, function () use ($key, $param) {
return $this->translator->trace($key, function () use ($key, $param) {
return $this->config->trace($key, $param);
});
});
}
public function get(string $key): array
{
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
{
return $this->collection->trace($key, function () use ($key, $param) {
return $this->translator->trace($key, function () use ($key, $param) {
return $this->config->trace($key, $param);
});
});
}
public function get(string $key): array
{
return array_merge(
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, function () use ($key, $param) {
return $this->getDecorated()->trace($key, $param);
});
}
public function get(string $key): array
{
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, function () use ($key, $param) {
return $this->getDecorated()->trace($key, $param);
});
}
public function get(string $key): array
{
return array_unique(array_merge(
$value = $this->cache->get($key, function (ItemInterface $item) use ($productId, $request, $context, $criteria) {
$name = self::buildName($productId);
$response = $this->tracer->trace($name, function () use ($productId, $request, $context, $criteria) {
return $this->getDecorated()->load($productId, $request, $context, $criteria);
});
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
});
}
}
if ($recompute) {
$save = true;
$item->set($callback($item, $save));
if ($save) {
$pool->save($item);
}
}
/**
* {@inheritdoc}
*/
public function get(string $key, callable $callback, float $beta = null, array &$metadata = null)
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
/**
* {@inheritdoc}
*/
});
$item->tag($this->generateTags($productId, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
});
return CacheValueCompressor::uncompress($value);
}
public static function buildName(string $parentId): string
->addAssociation('mainCategories.category')
->addAssociation('media');
$this->eventDispatcher->dispatch(new ProductPageCriteriaEvent($productId, $criteria, $context));
$result = $this->productDetailRoute->load($productId, $request, $context, $criteria);
$product = $result->getProduct();
if ($product->getMedia()) {
$product->getMedia()->sort(function (ProductMediaEntity $a, ProductMediaEntity $b) {
return $a->getPosition() <=> $b->getPosition();
* @HttpCache()
* @Route("/detail/{productId}", name="frontend.detail.page", methods={"GET"})
*/
public function index(SalesChannelContext $context, Request $request): Response
{
$page = $this->productPageLoader->load($request, $context);
$this->hook(new ProductPageLoadedHook($page, $context));
$ratingSuccess = $request->get('success');
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
}
try {
return $kernel->handle($request, $type, $catch);
} finally {
// restore global state
Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
}
}
if ($this->surrogate) {
$this->surrogate->addSurrogateCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
/*
* Support stale-if-error given on Responses or as a config option.
* RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
* Cache-Control directives) that
// avoid that the backend sends no content
$subRequest->headers->remove('If-Modified-Since');
$subRequest->headers->remove('If-None-Match');
$response = $this->forward($subRequest, $catch);
if ($response->isCacheable()) {
$this->store($request, $response);
}
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
reload the cache by fetching a fresh response and caching it (if possible).
*/
$this->record($request, 'reload');
$response = $this->fetch($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$this->restoreResponseBody($request, $response);
if (HttpKernelInterface::MAIN_REQUEST === $type) {
&& $container->getParameter('shopware.http.cache.enabled');
if ($enabled && $container->has(CacheStore::class)) {
$kernel = new HttpCache($kernel, $container->get(CacheStore::class), null, ['debug' => $this->debug]);
}
$response = $kernel->handle($transformed, $type, $catch);
// fire event to trigger runtime events like seo url headers
$event = new BeforeSendResponseEvent($transformed, $response);
$container->get('event_dispatcher')->dispatch($event);
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true): HttpKernelResult
{
try {
return $this->doHandle($request, (int) $type, (bool) $catch);
} catch (DBALException $e) {
$connectionParams = self::getConnection()->getParams();
$message = str_replace([$connectionParams['url'], $connectionParams['password'], $connectionParams['user']], '******', $e->getMessage());
if ($_SERVER['COMPOSER_PLUGIN_LOADER'] ?? $_SERVER['DISABLE_EXTENSIONS'] ?? false) {
$kernel->setPluginLoader(new \Shopware\Core\Framework\Plugin\KernelPluginLoader\ComposerPluginLoader($classLoader));
}
$result = $kernel->handle($request);
$result->getResponse()->send();
$kernel->terminate($result->getRequest(), $result->getResponse());
No log messages
ProductNotFoundException
|
---|
Shopware\Core\Content\Product\Exception\ProductNotFoundException: Product for id 590682ef8d78483eae03cd7d553dd618 not found. at vendor/shopware/core/Content/Product/SalesChannel/Detail/ProductDetailRoute.php:127 at Shopware\Core\Content\Product\SalesChannel\Detail\ProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}() (vendor/shopware/core/Profiling/Profiler.php:57) at Shopware\Core\Profiling\Profiler::trace() (vendor/shopware/core/Content/Product/SalesChannel/Detail/ProductDetailRoute.php:156) at Shopware\Core\Content\Product\SalesChannel\Detail\ProductDetailRoute->load() (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:103) at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}() (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:328) at Shopware\Core\System\SystemConfig\SystemConfigService->trace() (custom/plugins/PickwareDhl/vendor/pickware/shopware-extensions-bundle/src/Mail/SystemConfigServiceDecorator.php:137) at Pickware\ShopwareExtensionsBundle\Mail\SystemConfigServiceDecorator->trace() (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:39) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/core/Framework/Adapter/Translation/Translator.php:99) at Shopware\Core\Framework\Adapter\Translation\Translator->trace() (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:40) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/core/Framework/Adapter/Cache/CacheTagCollection.php:43) at Shopware\Core\Framework\Adapter\Cache\CacheTagCollection->trace() (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:41) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace() (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:37) at Shopware\Storefront\Framework\Cache\CacheTracer->Shopware\Storefront\Framework\Cache\{closure}() (vendor/shopware/storefront/Theme/ThemeConfigValueAccessor.php:54) at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace() (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:38) at Shopware\Storefront\Framework\Cache\CacheTracer->trace() (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:104) at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->Shopware\Core\Content\Product\SalesChannel\Detail\{closure}() (vendor/symfony/cache-contracts/CacheTrait.php:70) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->doGet() (vendor/symfony/cache-contracts/CacheTrait.php:33) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->get() (vendor/shopware/core/Content/Product/SalesChannel/Detail/CachedProductDetailRoute.php:109) at Shopware\Core\Content\Product\SalesChannel\Detail\CachedProductDetailRoute->load() (vendor/shopware/storefront/Page/Product/ProductPageLoader.php:87) at Shopware\Storefront\Page\Product\ProductPageLoader->load() (vendor/shopware/storefront/Controller/ProductController.php:93) at Shopware\Storefront\Controller\ProductController->index() (vendor/symfony/http-kernel/HttpKernel.php:152) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:479) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:452) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:224) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle() (vendor/shopware/core/HttpKernel.php:153) at Shopware\Core\HttpKernel->doHandle() (vendor/shopware/core/HttpKernel.php:79) at Shopware\Core\HttpKernel->handle() (public/index.php:74) |