Shopware\Core\Content\Category\Exception\CategoryNotFoundException {#8034 -statusCode: 404 -headers: [] #parameters: array:1 [ "categoryId" => "851bf8a0faaf49958a47ed69307a7173" ] }
return new PageNotFoundException($pageId);
}
public static function categoryNotFound(string $id): ShopwareHttpException
{
return new CategoryNotFoundException($id);
}
public static function serviceCategoryNotFoundForSalesChannel(string $salesChannelName): self
{
return new self(
* @return CategoryMetaInformation
*/
private function getMetaInfoById(string $id, array $metaInfo): array
{
if (!\array_key_exists($id, $metaInfo)) {
throw CategoryException::categoryNotFound($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);
$value = $this->cache->get($key, function (ItemInterface $item) use ($active, $depth, $rootId, $request, $context, $criteria, $tags) {
$request->query->set('depth', (string) $depth);
$name = self::buildName($active);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($active, $rootId, $request, $context, $criteria));
$item->tag($this->generateTags($tags, $active, $rootId, $depth, $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;
}
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
public function trace(string $key, \Closure $param)
{
$this->traces[$key] = [];
$this->keys[$key] = true;
$result = $param();
unset($this->keys[$key]);
return $result;
}
throw new DecorationPatternException(self::class);
}
public function trace(string $key, \Closure $param)
{
return $this->collection->trace($key, fn () => $this->translator->trace($key, fn () => $this->config->trace($key, $param)));
}
public function get(string $key): array
{
return array_merge(
return $this->decorated;
}
public function trace(string $key, \Closure $param)
{
return $this->themeConfigAccessor->trace($key, fn () => $this->getDecorated()->trace($key, $param));
}
public function get(string $key): array
{
return array_unique(array_merge(
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, fn () => $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 ($active, $depth, $rootId, $request, $context, $criteria, $tags) {
$request->query->set('depth', (string) $depth);
$name = self::buildName($active);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($active, $rootId, $request, $context, $criteria));
$item->tag($this->generateTags($tags, $active, $rootId, $depth, $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): mixed
{
return $this->doGet($this, $key, $callback, $beta, $metadata);
}
/**
* {@inheritdoc}
*/
if ($key === null) {
return $this->getDecorated()->load($active, $rootId, $request, $context, $criteria);
}
$value = $this->cache->get($key, function (ItemInterface $item) use ($active, $depth, $rootId, $request, $context, $criteria, $tags) {
$request->query->set('depth', (string) $depth);
$name = self::buildName($active);
$response = $this->tracer->trace($name, fn () => $this->getDecorated()->load($active, $rootId, $request, $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;
});
try {
foreach (self::$profilers as $profiler) {
$profiler->start($name, $category, $tags);
}
$result = $closure();
} finally {
foreach (self::$profilers as $profiler) {
$profiler->stop($name);
}
}
}
#[Route(path: '/store-api/navigation/{activeId}/{rootId}', name: 'store-api.navigation', methods: ['GET', 'POST'], defaults: ['_entity' => 'category'])]
public function load(string $activeId, string $rootId, Request $request, SalesChannelContext $context, Criteria $criteria): NavigationRouteResponse
{
return Profiler::trace('navigation-route', function () use ($activeId, $rootId, $request, $context, $criteria) {
if ($context->hasState(...$this->states)) {
return $this->getDecorated()->load($activeId, $rootId, $request, $context, $criteria);
}
$depth = $request->query->getInt('depth', $request->request->getInt('depth', 2));
{
$activeId = $this->resolveAliasId($activeId, $context->getSalesChannel());
$rootId = $this->resolveAliasId($rootId, $context->getSalesChannel());
$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);
$languages = $this->getLanguages($context, $request);
$event = new CurrencyRouteRequestEvent($request, new Request(), $context);
$this->eventDispatcher->dispatch($event);
$navigation = $this->navigationLoader->load(
(string) $navigationId,
$context,
$salesChannel->getNavigationCategoryId(),
$salesChannel->getNavigationCategoryDepth()
);
);
return $page;
}
$page->setHeader(
$this->headerLoader->load($request, $context)
);
$page->setFooter(
$this->footerLoader->load($request, $context)
);
try {
foreach (self::$profilers as $profiler) {
$profiler->start($name, $category, $tags);
}
$result = $closure();
} finally {
foreach (self::$profilers as $profiler) {
$profiler->stop($name);
}
}
) {
}
public function load(Request $request, SalesChannelContext $context): Page
{
return Profiler::trace('generic-page-loader', function () use ($request, $context) {
$page = new Page();
$page->setMetaInformation((new MetaInformation())->assign([
'revisit' => '15 days',
'robots' => 'index,follow',
} else {
$acceptedCookies = $this->replaceRegexSigns($this->convertCookieGroupsToAcceptedString($cookieGroups, false, $deniedCookieGroups, $deniedCookies));
}
$acceptedCookies = $this->addExpectedCookies($acceptedCookies, $this->cookieService::EXPECTED_COOKIES);
$page = $this->genericPageLoader->load($request, $salesChannelContext);
$page->addExtension('acrisCookieConsent', new ArrayEntity([
'hasAccepted' => $hasAccepted,
'cookieGroups' => $cookieGroups,
'acceptedCookies' => $acceptedCookies,
) {
}
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
}
#[Route(path: '/navigation/{navigationId}', name: 'frontend.navigation.page', options: ['seo' => true], defaults: ['_httpCache' => true], methods: ['GET'])]
public function index(SalesChannelContext $context, Request $request): Response
{
$page = $this->navigationPageLoader->load($request, $context);
$this->hook(new NavigationPageLoadedHook($page, $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, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
$response = null;
try {
return $response = $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
}
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
{
if (!KernelFactory::$active) {
return parent::handle($request, $type, $catch);
}
if ($request->attributes->get('exception') !== null) {
return parent::handle($request, $type, $catch);
}
}
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): Response
{
if (!KernelFactory::$active) {
return $this->getKernel()->handle($request, $type, $catch);
}
/**
* When we have an external reverse proxy which is ESI capable, we can't use the internal HttpCache, as it will resolve the ESI tags
*/
{
if (!$this->booted) {
$this->boot();
}
return $this->getHttpKernel()->handle($request, $type, $catch);
}
public function boot(): void
{
if ($this->booted === true) {
&& $container->getParameter('shopware.http.cache.enabled');
if ($enabled && $container->has(CacheStore::class)) {
$kernel = new static::$httpCacheClass($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, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true): HttpKernelResult
{
try {
return $this->doHandle($request, $type, $catch);
} catch (Exception $e) {
/** @var Params|array{url?: string} $connectionParams */
$connectionParams = self::getConnection()->getParams();
$message = str_replace([$connectionParams['url'] ?? null, $connectionParams['password'] ?? null, $connectionParams['user'] ?? null], '******', $e->getMessage());
}
} else {
$kernel = new InstallerKernel($appEnv, $debug);
}
$result = $kernel->handle($request);
if ($result instanceof Response) {
$result->send();
$kernel->terminate($request, $result);
} else {
No log messages
CategoryNotFoundException
|
---|
Shopware\Core\Content\Category\Exception\CategoryNotFoundException: Category "851bf8a0faaf49958a47ed69307a7173" not found. at vendor/shopware/core/Content/Category/CategoryException.php:27 at Shopware\Core\Content\Category\CategoryException::categoryNotFound('851bf8a0faaf49958a47ed69307a7173') (vendor/shopware/core/Content/Category/SalesChannel/NavigationRoute.php:151) at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->getMetaInfoById('851bf8a0faaf49958a47ed69307a7173', array('4c59a9b05ba241aa917fd37ca38412cb' => array('path' => null, 'level' => '1'))) (vendor/shopware/core/Content/Category/SalesChannel/NavigationRoute.php:58) at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->load('851bf8a0faaf49958a47ed69307a7173', '4c59a9b05ba241aa917fd37ca38412cb', object(Request), object(SalesChannelContext), object(Criteria)) (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:102) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:416) at Shopware\Core\System\SystemConfig\SystemConfigService->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/core/Framework/Adapter/Translation/Translator.php:96) at Shopware\Core\Framework\Adapter\Translation\Translator->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/core/Framework/Adapter/Cache/CacheTagCollection.php:56) at Shopware\Core\Framework\Adapter\Cache\CacheTagCollection->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:33) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:35) at Shopware\Storefront\Framework\Cache\CacheTracer->Shopware\Storefront\Framework\Cache\{closure}() (vendor/shopware/storefront/Theme/ThemeConfigValueAccessor.php:76) at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:35) at Shopware\Storefront\Framework\Cache\CacheTracer->trace('navigation-route-851bf8a0faaf49958a47ed69307a7173', object(Closure)) (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:102) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}(object(CacheItem), true) (vendor/symfony/cache-contracts/CacheTrait.php:70) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->doGet(object(CacheDecorator), 'navigation-route-851bf8a0faaf49958a47ed69307a7173-538912a071e88884ecddbcb4380c3e49', object(Closure), 1.0, array()) (vendor/symfony/cache-contracts/CacheTrait.php:33) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->get('navigation-route-851bf8a0faaf49958a47ed69307a7173-538912a071e88884ecddbcb4380c3e49', object(Closure)) (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:97) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->loadNavigation(object(Request), '851bf8a0faaf49958a47ed69307a7173', '4c59a9b05ba241aa917fd37ca38412cb', 0, object(SalesChannelContext), object(Criteria), array('navigation')) (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:73) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/core/Profiling/Profiler.php:67) at Shopware\Core\Profiling\Profiler::trace('navigation-route', object(Closure)) (vendor/shopware/core/Content/Category/SalesChannel/CachedNavigationRoute.php:57) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->load('851bf8a0faaf49958a47ed69307a7173', '4c59a9b05ba241aa917fd37ca38412cb', object(Request), object(SalesChannelContext), object(Criteria)) (vendor/shopware/core/Content/Category/SalesChannel/TreeBuildingNavigationRoute.php:38) at Shopware\Core\Content\Category\SalesChannel\TreeBuildingNavigationRoute->load('851bf8a0faaf49958a47ed69307a7173', '4c59a9b05ba241aa917fd37ca38412cb', object(Request), object(SalesChannelContext), object(Criteria)) (vendor/shopware/core/Content/Category/Service/NavigationLoader.php:49) at Shopware\Core\Content\Category\Service\NavigationLoader->load('851bf8a0faaf49958a47ed69307a7173', object(SalesChannelContext), '4c59a9b05ba241aa917fd37ca38412cb', 3) (vendor/shopware/storefront/Pagelet/Header/HeaderPageletLoader.php:55) at Shopware\Storefront\Pagelet\Header\HeaderPageletLoader->load(object(Request), object(SalesChannelContext)) (vendor/shopware/storefront/Page/GenericPageLoader.php:56) at Shopware\Storefront\Page\GenericPageLoader->Shopware\Storefront\Page\{closure}() (vendor/shopware/core/Profiling/Profiler.php:67) at Shopware\Core\Profiling\Profiler::trace('generic-page-loader', object(Closure)) (vendor/shopware/storefront/Page/GenericPageLoader.php:38) at Shopware\Storefront\Page\GenericPageLoader->load(object(Request), object(SalesChannelContext)) (vendor/store.shopware.com/acriscookieconsentcs/src/Storefront/Page/GenericPageLoader.php:92) at Acris\CookieConsent\Storefront\Page\GenericPageLoader->load(object(Request), object(SalesChannelContext)) (vendor/shopware/storefront/Page/Navigation/NavigationPageLoader.php:35) at Shopware\Storefront\Page\Navigation\NavigationPageLoader->load(object(Request), object(SalesChannelContext)) (vendor/shopware/storefront/Controller/NavigationController.php:45) at Shopware\Storefront\Controller\NavigationController->index(object(SalesChannelContext), object(Request)) (vendor/symfony/http-kernel/HttpKernel.php:181) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:76) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/shopware/core/Framework/Adapter/Kernel/HttpKernel.php:44) at Shopware\Core\Framework\Adapter\Kernel\HttpKernel->handle(object(Request), 1, true) (vendor/shopware/core/Framework/Adapter/Kernel/HttpCacheKernel.php:50) at Shopware\Core\Framework\Adapter\Kernel\HttpCacheKernel->handle(object(Request), 1, true) (vendor/shopware/core/Kernel.php:157) at Shopware\Core\Kernel->handle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:146) at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:67) at Shopware\Core\HttpKernel->handle(object(Request)) (public/index.php:85) |