if (($category->getType() === CategoryDefinition::TYPE_FOLDER
|| $category->getType() === CategoryDefinition::TYPE_LINK)
&& $context->getSalesChannel()->getNavigationCategoryId() !== $navigationId
) {
throw new CategoryNotFoundException($navigationId);
}
$pageId = $category->getCmsPageId();
$slotConfig = $category->getTranslation('slotConfig');
$this->logger->info('cache-miss: ' . self::buildName($navigationId));
$name = self::buildName($navigationId);
$response = $this->tracer->trace($name, function () use ($navigationId, $request, $context) {
return $this->getDecorated()->load($navigationId, $request, $context);
});
$item = CacheCompressor::compress($item, $response);
$item->tag($this->generateTags($navigationId, $response, $request, $context));
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 mixed|null All kind of data could be cached
*/
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 trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
/**
* @return mixed|null All kind of data could be cached
*/
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 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;
}
return $this->decorated;
}
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
}
$this->logger->info('cache-miss: ' . self::buildName($navigationId));
$name = self::buildName($navigationId);
$response = $this->tracer->trace($name, function () use ($navigationId, $request, $context) {
return $this->getDecorated()->load($navigationId, $request, $context);
});
$item = CacheCompressor::compress($item, $response);
*
* @Route("/store-api/category/{navigationId}", name="store-api.category.detail", methods={"GET","POST"})
*/
public function load(string $navigationId, Request $request, SalesChannelContext $context): CategoryRouteResponse
{
$response = $this->inner->load($navigationId, $request, $context);
$route = $request->attributes->get('_route');
if (!\is_string($route) || empty($route)) {
return $response;
$page = NavigationPage::createFrom($page);
$navigationId = $request->get('navigationId', $context->getSalesChannel()->getNavigationCategoryId());
$category = $this->cmsPageRoute
->load($navigationId, $request, $context)
->getCategory();
if (!$category->getActive()) {
throw new CategoryNotFoundException($category->getId());
}
* @HttpCache()
* @Route("/navigation/{navigationId}", name="frontend.navigation.page", options={"seo"=true}, methods={"GET"})
*/
public function index(SalesChannelContext $context, Request $request): Response
{
$page = $this->navigationPageLoader->load($request, $context);
return $this->renderStorefront('@Storefront/storefront/page/content/index.html.twig', ['page' => $page]);
}
/**
$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;
}
}
&& $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());
}
$request = Request::createFromGlobals();
$kernel = new HttpKernel($appEnv, $debug, $classLoader);
$result = $kernel->handle($request);
$result->getResponse()->send();
$kernel->terminate($result->getRequest(), $result->getResponse());
No log messages
CategoryNotFoundException
|
---|
Shopware\Core\Content\Category\Exception\CategoryNotFoundException: Category "660afafd33284b2c9e5119a8fb452799" not found. at vendor/shopware/core/Content/Category/SalesChannel/CategoryRoute.php:112 at Shopware\Core\Content\Category\SalesChannel\CategoryRoute->load('660afafd33284b2c9e5119a8fb452799', object(Request), object(SalesChannelContext)) (vendor/shopware/core/Content/Category/SalesChannel/CachedCategoryRoute.php:134) at Shopware\Core\Content\Category\SalesChannel\CachedCategoryRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:349) at Shopware\Core\System\SystemConfig\SystemConfigService->trace('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (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('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:38) 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('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:37) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (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:53) at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:36) at Shopware\Storefront\Framework\Cache\CacheTracer->trace('category-route-660afafd33284b2c9e5119a8fb452799', object(Closure)) (vendor/shopware/core/Content/Category/SalesChannel/CachedCategoryRoute.php:133) at Shopware\Core\Content\Category\SalesChannel\CachedCategoryRoute->load('660afafd33284b2c9e5119a8fb452799', object(Request), object(SalesChannelContext)) (custom/plugins/SwagPayPal/src/Checkout/ExpressCheckout/SalesChannel/ExpressCategoryRoute.php:93) at Swag\PayPal\Checkout\ExpressCheckout\SalesChannel\ExpressCategoryRoute->load('660afafd33284b2c9e5119a8fb452799', object(Request), object(SalesChannelContext)) (vendor/shopware/storefront/Page/Navigation/NavigationPageLoader.php:61) at Shopware\Storefront\Page\Navigation\NavigationPageLoader->load(object(Request), object(SalesChannelContext)) (vendor/shopware/storefront/Controller/NavigationController.php:51) at Shopware\Storefront\Controller\NavigationController->index(object(SalesChannelContext), object(Request)) (vendor/symfony/http-kernel/HttpKernel.php:156) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:78) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:199) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:181) at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:81) at Shopware\Core\HttpKernel->handle(object(Request)) (public/index.php:87) |