Symfony\Component\HttpKernel\Exception\NotFoundHttpException {#3497 -statusCode: 404 -headers: [] }
}
public function getBlogPost($postId, SalesChannelContext $salesChannelContext, Context $context)
{
if( ! Uuid::isValid($postId)) {
throw new NotFoundHttpException('No valid UUID');
}
$repo = $this->container->get('s_plugin_netzp_blog.repository');
$criteria = new Criteria();
}
#[Route(path: '/store-api/blogpost/{postId}', name: 'store-api.s_plugin_netzp_blog.load', methods: ['GET', 'POST'], defaults: ['_routeScope' => ['store-api']])]
public function load(string $postId, Criteria $criteria, SalesChannelContext $salesChannelContext): BlogPostRouteResponse
{
$post = $this->helper->getBlogPost($postId, $salesChannelContext, $salesChannelContext->getContext());
return new BlogPostRouteResponse($post);
}
}
catch (\Throwable $e) {
$this->logger->error($e->getMessage());
}
$name = self::buildName($postId);
$response = $this->tracer->trace($name, fn() => $this->getDecorated()->load($postId, $criteria, $context));
$item = CacheCompressor::compress($item, $response);
$item->tag(array_merge(
$this->tracer->get(self::buildName($postId)),
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, 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;
}
/**
* @return mixed|null All kind of data could be cached
*/
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;
}
/**
* @return mixed|null All kind of data could be cached
*/
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(
catch (\Throwable $e) {
$this->logger->error($e->getMessage());
}
$name = self::buildName($postId);
$response = $this->tracer->trace($name, fn() => $this->getDecorated()->load($postId, $criteria, $context));
$item = CacheCompressor::compress($item, $response);
$item->tag(array_merge(
$this->tracer->get(self::buildName($postId)),
}
public function load(Request $request, SalesChannelContext $context, string $postId): BlogPage
{
$criteria = new Criteria([$postId]);
$post = $this->blogRoute->load($postId, $criteria, $context)->getBlogPost();
if(! $post) {
throw new NotFoundHttpException('Blog post not found');
}
$config = $this->config->get('NetzpBlog6.config', $context->getSalesChannelId());
public function getPost(Request $request, SalesChannelContext $salesChannelContext, Context $context, $postId)
{
$shariffIsActive = $this->helper->isPluginActive('NetzpShariff6', $context);
$config = $this->config->get('NetzpBlog6.config', $salesChannelContext->getSalesChannel()->getId());
$page = $this->blogPageLoader->load($request, $salesChannelContext, $postId);
$template = $page->isCmsPage() ? 'storefront/page/content/index.html.twig' : 'storefront/page/blog/post.html.twig';
return $this->renderStorefront($template, [
'page' => $page,
'post' => $page->getPost(),
$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;
}
$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);
}
}
protected function forward(Request $request, bool $catch = false, Response $entry = null)
{
$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 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());
$this->httpKernel = $httpKernel;
}
public function handle(Request $request, int $type = self::MAIN_REQUEST, bool $catch = true): Response
{
return $this->httpKernel->handle($request, $type, $catch)->getResponse();
}
public function terminate(Request $request, Response $response): void
{
$this->httpKernel->terminate($request, $response);
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
require_once __DIR__ . '/../vendor/autoload_runtime.php';
if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
$_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
}
No log messages
NotFoundHttpException
|
---|
Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No valid UUID at custom/plugins/NetzpBlog6/src/Helper/BlogHelper.php:125 at NetzpBlog6\Helper\BlogHelper->getBlogPost('composer.html', object(SalesChannelContext), object(Context)) (custom/plugins/NetzpBlog6/src/Controller/StoreApi/BlogPost/BlogPostRoute.php:25) at NetzpBlog6\Controller\StoreApi\BlogPost\BlogPostRoute->load('composer.html', object(Criteria), object(SalesChannelContext)) (custom/plugins/NetzpBlog6/src/Controller/StoreApi/BlogPost/CachedBlogPostRoute.php:53) at NetzpBlog6\Controller\StoreApi\BlogPost\CachedBlogPostRoute->NetzpBlog6\Controller\StoreApi\BlogPost\{closure}() (vendor/shopware/core/System/SystemConfig/SystemConfigService.php:411) at Shopware\Core\System\SystemConfig\SystemConfigService->trace('blog-post-route-composer.html', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:36) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->Shopware\Core\Framework\Adapter\Cache\{closure}() (vendor/shopware/core/Framework/Adapter/Translation/Translator.php:98) at Shopware\Core\Framework\Adapter\Translation\Translator->trace('blog-post-route-composer.html', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:36) 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('blog-post-route-composer.html', object(Closure)) (vendor/shopware/core/Framework/Adapter/Cache/CacheTracer.php:36) at Shopware\Core\Framework\Adapter\Cache\CacheTracer->trace('blog-post-route-composer.html', object(Closure)) (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:33) at Shopware\Storefront\Framework\Cache\CacheTracer->Shopware\Storefront\Framework\Cache\{closure}() (vendor/shopware/storefront/Theme/ThemeConfigValueAccessor.php:72) at Shopware\Storefront\Theme\ThemeConfigValueAccessor->trace('blog-post-route-composer.html', object(Closure)) (vendor/shopware/storefront/Framework/Cache/CacheTracer.php:33) at Shopware\Storefront\Framework\Cache\CacheTracer->trace('blog-post-route-composer.html', object(Closure)) (custom/plugins/NetzpBlog6/src/Controller/StoreApi/BlogPost/CachedBlogPostRoute.php:53) at NetzpBlog6\Controller\StoreApi\BlogPost\CachedBlogPostRoute->load('composer.html', object(Criteria), object(SalesChannelContext)) (custom/plugins/NetzpBlog6/src/Storefront/Page/BlogPageLoader.php:31) at NetzpBlog6\Storefront\Page\BlogPageLoader->load(object(Request), object(SalesChannelContext), 'composer.html') (custom/plugins/NetzpBlog6/src/Controller/BlogController.php:41) at NetzpBlog6\Controller\BlogController->getPost(object(Request), object(SalesChannelContext), object(Context), 'composer.html') (vendor/symfony/http-kernel/HttpKernel.php:182) 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/symfony/http-kernel/Kernel.php:197) at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(object(Kernel), object(Request), 1, true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:473) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:448) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:346) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(object(Request), true) (vendor/symfony/http-kernel/HttpCache/HttpCache.php:221) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:143) at Shopware\Core\HttpKernel->doHandle(object(Request), 1, true) (vendor/shopware/core/HttpKernel.php:65) at Shopware\Core\HttpKernel->handle(object(Request), 1, true) (public/index.php:71) at Symfony\Component\HttpKernel\HttpKernelInterface@anonymous /www/htdocs/w0176f45/ebike-shopware/public/index.php:61$0->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/www/htdocs/w0176f45/ebike-shopware/vendor/autoload_runtime.php') (public/index.php:14) |