}
private function getMetaInfoById(string $id, array $metaInfo): array
{
if (!\array_key_exists($id, $metaInfo)) {
throw new CategoryNotFoundException($id);
}
return $metaInfo[$id];
}
): NavigationRouteResponse {
$depth = $request->query->getInt('depth', $request->request->getInt('depth', 2));
$metaInfo = $this->getCategoryMetaInfo($activeId, $rootId);
$active = $this->getMetaInfoById($activeId, $metaInfo);
$root = $this->getMetaInfoById($rootId, $metaInfo);
// Validate the provided category is part of the sales channel
$this->validate($activeId, $active['path'], $context);
$request->query->set('depth', (string) $depth);
$name = self::buildName($active);
$response = $this->tracer->trace($name, function () use ($active, $rootId, $request, $context, $criteria) {
return $this->getDecorated()->load($active, $rootId, $request, $context, $criteria);
});
$item = CacheCompressor::compress($item, $response);
$item->tag($this->generateTags($tags, $active, $rootId, $depth, $request, $response, $context, $criteria));
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;
}
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(
$name = self::buildName($active);
$response = $this->tracer->trace($name, function () use ($active, $rootId, $request, $context, $criteria) {
return $this->getDecorated()->load($active, $rootId, $request, $context, $criteria);
});
$item = CacheCompressor::compress($item, $response);
$item->tag($this->generateTags($tags, $active, $rootId, $depth, $request, $response, $context, $criteria));
if ($this->isActiveLoaded($rootId, $response->getCategories(), $activeId)) {
return $response;
}
// reload missing children of active category, depth 0 allows us the skip base navigation loading in the core route
$active = $this->loadNavigation($request, $activeId, $rootId, 0, $context, $criteria, [self::ALL_TAG]);
$response->getCategories()->merge($active->getCategories());
return $response;
}
if ($rootId === null) {
throw new CategoryNotFoundException($request->get('rootId'));
}
$response = $this->getDecorated()->load($activeId, $rootId, $request, $context, $criteria);
$buildTree = $request->query->getBoolean('buildTree', $request->request->getBoolean('buildTree', true));
if (!$buildTree) {
return $response;
$criteria = new Criteria();
$criteria->setTitle('header::navigation');
$categories = $this->navigationRoute
->load($activeId, $rootId, $request, $context, $criteria)
->getCategories();
$navigation = $this->getTree($rootId, $categories, $categories->get($activeId));
$event = new NavigationLoadedEvent($navigation, $context);
$navigation = $this->navigationLoader->load(
(string) $navigationId,
$context,
$salesChannel->getNavigationCategoryId(),
$salesChannel->getNavigationCategoryDepth()
);
$criteria = new Criteria();
$criteria->setTitle('header::currencies');
);
return $page;
}
$page->setHeader(
$this->headerLoader->load($request, $context)
);
$page->setFooter(
$this->footerLoader->load($request, $context)
);
$this->seoUrlReplacer = $seoUrlReplacer;
}
public function load(Request $request, SalesChannelContext $context): NavigationPage
{
$page = $this->genericLoader->load($request, $context);
$page = NavigationPage::createFrom($page);
$navigationId = $request->get('navigationId', $context->getSalesChannel()->getNavigationCategoryId());
$category = $this->cmsPageRoute
* @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) {
$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 "b67c58aed7bf4883ad04ee9e42edf3a6" not found. at vendor/shopware/core/Content/Category/SalesChannel/NavigationRoute.php:253 at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->getMetaInfoById() (vendor/shopware/core/Content/Category/SalesChannel/NavigationRoute.php:127) at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->load() (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:191) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:349) at Shopware\Core\System\SystemConfig\SystemConfigService->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:93) 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:53) 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/Category/SalesChannel/CachedNavigationRoute.php:192) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->loadNavigation() (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:156) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->load() (vendor/shopware/core/Content/Category/SalesChannel/TreeBuildingNavigationRoute.php:108) at Shopware\Core\Content\Category\SalesChannel\TreeBuildingNavigationRoute->load() (vendor/shopware/core/Content/Category/Service/NavigationLoader.php:62) at Shopware\Core\Content\Category\Service\NavigationLoader->load() (vendor/shopware/storefront/Pagelet/Header/HeaderPageletLoader.php:79) at Shopware\Storefront\Pagelet\Header\HeaderPageletLoader->load() (vendor/shopware/storefront/Page/GenericPageLoader.php:90) at Shopware\Storefront\Page\GenericPageLoader->load() (vendor/shopware/storefront/Page/Navigation/NavigationPageLoader.php:55) at Shopware\Storefront\Page\Navigation\NavigationPageLoader->load() (vendor/shopware/storefront/Controller/NavigationController.php:51) at Shopware\Storefront\Controller\NavigationController->index() (vendor/symfony/http-kernel/HttpKernel.php:156) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:78) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:199) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/shopware/core/HttpKernel.php:178) at Shopware\Core\HttpKernel->doHandle() (vendor/shopware/core/HttpKernel.php:81) at Shopware\Core\HttpKernel->handle() (public/index.php:83) |