if ($this->isChildCategory($activeId, $path, $id)) {
return;
}
}
throw new CategoryNotFoundException($activeId);
}
private function isChildCategory(string $activeId, ?string $path, string $rootId): bool
{
if ($rootId === $activeId) {
$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);
$isChild = $this->isChildCategory($activeId, $active['path'], $rootId);
// If the provided activeId is not part of the rootId, a fallback to the rootId must be made here.
// The passed activeId is therefore part of another navigation and must therefore not be loaded.
$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->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;
}
$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(
$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->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);
}
}
*
* @return mixed
*/
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($tags, $active, $rootId, $depth, $request, $response, $context, $criteria));
return CacheValueCompressor::compress($response);
});
return CacheValueCompressor::uncompress($value);
}
private function isActiveLoaded(string $root, CategoryCollection $categories, string $activeId): bool
}
$depth = $request->query->getInt('depth', $request->request->getInt('depth', 2));
// first we load the base navigation, the base navigation is shared for all storefront listings
$response = $this->loadNavigation($request, $rootId, $rootId, $depth, $context, $criteria, [self::ALL_TAG, self::BASE_NAVIGATION_TAG]);
// no we have to check if the active category is loaded and the children of the active category are loaded
if ($this->isActiveLoaded($rootId, $response->getCategories(), $activeId)) {
return $response;
}
try {
foreach (self::$profilers as $profiler) {
$profiler->start($name, $category, $tags);
}
$result = $closure();
} finally {
foreach (self::$profilers as $profiler) {
$profiler->stop($name);
}
}
$active = $this->loadNavigation($request, $activeId, $rootId, 0, $context, $criteria, [self::ALL_TAG]);
$response->getCategories()->merge($active->getCategories());
return $response;
});
}
public static function buildName(string $id): string
{
return 'navigation-route-' . $id;
{
$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);
$navigationId = (string) $request->query->get('navigationId', $context->getSalesChannel()->getNavigationCategoryId());
if (!$navigationId) {
throw new MissingRequestParameterException('navigationId');
}
$navigation = $this->navigationLoader->load($navigationId, $context, $navigationId, 1);
$pagelet = new MenuOffcanvasPagelet($navigation);
$this->eventDispatcher->dispatch(
new MenuOffcanvasPageletLoadedEvent($pagelet, $context, $request)
* @HttpCache()
* @Route("/widgets/menu/offcanvas", name="frontend.menu.offcanvas", methods={"GET"}, defaults={"XmlHttpRequest"=true})
*/
public function offcanvas(Request $request, SalesChannelContext $context): Response
{
$page = $this->offcanvasLoader->load($request, $context);
$header = $this->headerPageletLoader->load($request, $context);
$navigationId = (string)$request->query->get('navigationId', $context->getSalesChannel()->getNavigationCategoryId());
$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);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
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 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);
if (!\is_bool($catch)) {
Feature::triggerDeprecationOrThrow('v6.5.0.0', 'The third parameter `$catch` of `HttpKernel->handle()` will be typed to `bool`');
}
try {
return $this->doHandle($request, (int) $type, (bool) $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());
}
$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 "00bdbaf1f7e74f048eba9aadfb7d9121" not found. at vendor/shopware/platform/src/Core/Content/Category/SalesChannel/NavigationRoute.php:213 at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->validate() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/NavigationRoute.php:81) at Shopware\Core\Content\Category\SalesChannel\NavigationRoute->load() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/CachedNavigationRoute.php:136) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/platform/src/Core/System/SystemConfig/SystemConfigService.php:350) at Shopware\Core\System\SystemConfig\SystemConfigService->trace() (custom/plugins/PickwareErpStarter/vendor/pickware/shopware-extensions-bundle/src/Mail/SystemConfigServiceDecorator.php:137) at Pickware\ShopwareExtensionsBundle\Mail\SystemConfigServiceDecorator->trace() (vendor/shopware/platform/src/Core/Framework/Adapter/Cache/CacheTracer.php:44) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/platform/src/Core/Framework/Adapter/Translation/Translator.php:120) at Shopware\Core\Framework\Adapter\Translation\Translator->trace() (vendor/shopware/platform/src/Core/Framework/Adapter/Cache/CacheTracer.php:45) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/platform/src/Core/Framework/Adapter/Cache/CacheTagCollection.php:46) at Shopware\Core\Framework\Adapter\Cache\CacheTagCollection->trace() (vendor/shopware/platform/src/Core/Framework/Adapter/Cache/CacheTracer.php:46) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace() (vendor/shopware/platform/src/Storefront/Framework/Cache/CacheTracer.php:41) at Shopware\Storefront\Framework\Cache\CacheTracer->Shopware\Storefront\Framework\Cache\{closure}() (vendor/shopware/platform/src/Storefront/Theme/ThemeConfigValueAccessor.php:59) at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace() (vendor/shopware/platform/src/Storefront/Framework/Cache/CacheTracer.php:42) at Shopware\Storefront\Framework\Cache\CacheTracer->trace() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/CachedNavigationRoute.php:137) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/symfony/cache-contracts/CacheTrait.php:72) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->doGet() (vendor/symfony/cache-contracts/CacheTrait.php:35) at Shopware\Core\Framework\Adapter\Cache\CacheDecorator->get() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/CachedNavigationRoute.php:142) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->loadNavigation() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/CachedNavigationRoute.php:98) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->Shopware\Core\Content\Category\SalesChannel\{closure}() (vendor/shopware/platform/src/Core/Profiling/Profiler.php:59) at Shopware\Core\Profiling\Profiler::trace() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/CachedNavigationRoute.php:111) at Shopware\Core\Content\Category\SalesChannel\CachedNavigationRoute->load() (vendor/shopware/platform/src/Core/Content/Category/SalesChannel/TreeBuildingNavigationRoute.php:48) at Shopware\Core\Content\Category\SalesChannel\TreeBuildingNavigationRoute->load() (vendor/shopware/platform/src/Core/Content/Category/Service/NavigationLoader.php:68) at Shopware\Core\Content\Category\Service\NavigationLoader->load() (vendor/shopware/platform/src/Storefront/Pagelet/Menu/Offcanvas/MenuOffcanvasPageletLoader.php:52) at Shopware\Storefront\Pagelet\Menu\Offcanvas\MenuOffcanvasPageletLoader->load() (custom/plugins/CoffeeBTheme/src/Storefront/Controller/NavigationController.php:66) at CoffeeBTheme\Storefront\Controller\NavigationController->offcanvas() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/shopware/platform/src/Core/HttpKernel.php:156) at Shopware\Core\HttpKernel->doHandle() (vendor/shopware/platform/src/Core/HttpKernel.php:81) at Shopware\Core\HttpKernel->handle() (public/index.php:50) |