Exceptions
Exceptions 2
Twig\Error\ RuntimeError
in
templates/base.html.twig
(line 77)
{% if ga_events_search %}
{{ ga_events_search(q, prods)|raw }}
{% endif %}
{% if ga_events_prodlist %}
{{ ga_events_prodlist(prods)|raw }}
{% endif %}
{% if ga_events_prodcont %}
{{ ga_events_prodcont(prod)|raw }}
{% endif %}
in
var/cache/dev/twig/07/0729f85fe80c9da6fbddb8556b12a70f.php
->
yield
(line 53)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "catalog/list.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "catalog/list.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 388)
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
yield
(line 344)
return $this->blocks;
}
public function display(array $context, array $blocks = []): void
{
foreach ($this->yield($context, $blocks) as $data) {
echo $data;
}
}
public function render(array $context): string
in
vendor/twig/twig/src/Template.php
->
display
(line 359)
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
in
vendor/twig/twig/src/TemplateWrapper.php
->
render
(line 51)
yield from $this->template->yieldBlock($name, $context);
}
public function render(array $context = []): string
{
return $this->template->render($context);
}
/**
* @return void
*/
in
vendor/twig/twig/src/Environment.php
->
render
(line 334)
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = []): string
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
render
(line 220)
{
if (!$this->container->has('twig')) {
throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
}
return $this->container->get('twig')->render($view, $parameters);
}
/**
* Renders a view.
*/
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
renderView
(line 228)
/**
* Renders a view.
*/
protected function render(string $view, array $parameters = [], Response $response = null): Response
{
$content = $this->renderView($view, $parameters);
if (null === $response) {
$response = new Response();
}
'showcont' => $showcont,
'prodstable' => $prodstable,
'cart_items' => $this->ModelCart->getCart(),
'ga_events_search' => $ga_events_search,
'ga_events_prodlist' => $ga_events_prodlist,
'q' => $request->get('q', ''),
]);
}
#[Route('/catalog/prod-{prod_id}', name: 'prod_cont_no_locale', defaults: ['_locale' => '%app.default_lang%'])]
#[Route('/{_locale}/catalog/prod-{prod_id}', name: 'prod_cont', requirements: ['_locale' => '%app.langs%'])]
in
vendor/symfony/http-kernel/HttpKernel.php
->
prodList
(line 163)
$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);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$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) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
in
vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php
->
handle
(line 86)
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);
}
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
::
handle
(line 457)
if ($this->surrogate) {
$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
in
vendor/symfony/framework-bundle/HttpCache/HttpCache.php
->
forward
(line 71)
protected function forward(Request $request, bool $catch = false, Response $entry = null): Response
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);
return parent::forward($request, $catch, $entry);
}
/**
* Returns an array of options to customize the Cache configuration.
*/
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
forward
(line 430)
// 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);
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
fetch
(line 328)
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
lookup
(line 212)
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) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
{
if (!$this->booted) {
$container = $this->container ?? $this->preBoot();
if ($container->has('http_cache')) {
return $container->get('http_cache')->handle($request, $type, $catch);
}
}
$this->boot();
++$this->requestStackSize;
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
$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);
}
in
vendor/autoload_runtime.php
->
run
(line 29)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php')
in
public/index.php
(line 5)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
ErrorException
in
src/Twig/GoogleAnalyticsEvents.php
(line 142)
public function prodList(array $prods)
{
$sum = 0;
$i = 0;
for ($i = 0; $i < 10; $i++) {
$prod = $prods[$i];
$sum += $prod->getPrice() * (100 - $prod->getSkidka()) / 100;
}
$result = '<script>gtag("event", "view_item_list", {
currency: "'.Env::currency_code().'",
in
var/cache/dev/twig/4d/4d545bd4c76ce0d28cf9d9c5e0226cba.php
->
prodList
(line 242)
\t\t";
// line 76
if (($context["ga_events_prodlist"] ?? null)) {
// line 77
yield "\t\t\t";
yield $this->extensions['App\Twig\GoogleAnalyticsEvents']->prodList(($context["prods"] ?? null));
yield "
\t\t";
}
// line 79
yield "
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 388)
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
var/cache/dev/twig/07/0729f85fe80c9da6fbddb8556b12a70f.php
->
yield
(line 53)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "catalog/list.html.twig"));
$this->parent = $this->loadTemplate("base.html.twig", "catalog/list.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 388)
{
$context += $this->env->getGlobals();
$blocks = array_merge($this->blocks, $blocks);
try {
yield from $this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
yield
(line 344)
return $this->blocks;
}
public function display(array $context, array $blocks = []): void
{
foreach ($this->yield($context, $blocks) as $data) {
echo $data;
}
}
public function render(array $context): string
in
vendor/twig/twig/src/Template.php
->
display
(line 359)
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
in
vendor/twig/twig/src/TemplateWrapper.php
->
render
(line 51)
yield from $this->template->yieldBlock($name, $context);
}
public function render(array $context = []): string
{
return $this->template->render($context);
}
/**
* @return void
*/
in
vendor/twig/twig/src/Environment.php
->
render
(line 334)
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = []): string
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
render
(line 220)
{
if (!$this->container->has('twig')) {
throw new \LogicException('You cannot use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
}
return $this->container->get('twig')->render($view, $parameters);
}
/**
* Renders a view.
*/
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
renderView
(line 228)
/**
* Renders a view.
*/
protected function render(string $view, array $parameters = [], Response $response = null): Response
{
$content = $this->renderView($view, $parameters);
if (null === $response) {
$response = new Response();
}
'showcont' => $showcont,
'prodstable' => $prodstable,
'cart_items' => $this->ModelCart->getCart(),
'ga_events_search' => $ga_events_search,
'ga_events_prodlist' => $ga_events_prodlist,
'q' => $request->get('q', ''),
]);
}
#[Route('/catalog/prod-{prod_id}', name: 'prod_cont_no_locale', defaults: ['_locale' => '%app.default_lang%'])]
#[Route('/{_locale}/catalog/prod-{prod_id}', name: 'prod_cont', requirements: ['_locale' => '%app.langs%'])]
in
vendor/symfony/http-kernel/HttpKernel.php
->
prodList
(line 163)
$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);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$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) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
in
vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php
->
handle
(line 86)
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);
}
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
::
handle
(line 457)
if ($this->surrogate) {
$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
in
vendor/symfony/framework-bundle/HttpCache/HttpCache.php
->
forward
(line 71)
protected function forward(Request $request, bool $catch = false, Response $entry = null): Response
{
$this->getKernel()->boot();
$this->getKernel()->getContainer()->set('cache', $this);
return parent::forward($request, $catch, $entry);
}
/**
* Returns an array of options to customize the Cache configuration.
*/
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
forward
(line 430)
// 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);
}
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
fetch
(line 328)
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
in
vendor/symfony/http-kernel/HttpCache/HttpCache.php
->
lookup
(line 212)
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) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
{
if (!$this->booted) {
$container = $this->container ?? $this->preBoot();
if ($container->has('http_cache')) {
return $container->get('http_cache')->handle($request, $type, $catch);
}
}
$this->boot();
++$this->requestStackSize;
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
$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);
}
in
vendor/autoload_runtime.php
->
run
(line 29)
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php')
in
public/index.php
(line 5)
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
Stack Traces 2
[2/2]
RuntimeError
|
---|
Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Warning: Undefined array key 1"). at templates/base.html.twig:77 at Twig\Template->yield() (var/cache/dev/twig/07/0729f85fe80c9da6fbddb8556b12a70f.php:53) at __TwigTemplate_d266ab2a2eec13e50041abaac20d1f6a->doDisplay() (vendor/twig/twig/src/Template.php:388) at Twig\Template->yield() (vendor/twig/twig/src/Template.php:344) at Twig\Template->display() (vendor/twig/twig/src/Template.php:359) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:51) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:334) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:220) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (vendor/symfony/framework-bundle/Controller/AbstractController.php:228) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render() (src/Controller/CatalogController.php:478) at App\Controller\CatalogController->prodList() (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/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:457) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward() (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:71) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:430) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:328) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:212) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle() (vendor/symfony/http-kernel/Kernel.php:193) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php') (public/index.php:5) |
[1/2]
ErrorException
|
---|
ErrorException: Warning: Undefined array key 1 at src/Twig/GoogleAnalyticsEvents.php:142 at App\Twig\GoogleAnalyticsEvents->prodList() (var/cache/dev/twig/4d/4d545bd4c76ce0d28cf9d9c5e0226cba.php:242) at __TwigTemplate_9e7ca6574451c71acd652472e0f12251->doDisplay() (vendor/twig/twig/src/Template.php:388) at Twig\Template->yield() (var/cache/dev/twig/07/0729f85fe80c9da6fbddb8556b12a70f.php:53) at __TwigTemplate_d266ab2a2eec13e50041abaac20d1f6a->doDisplay() (vendor/twig/twig/src/Template.php:388) at Twig\Template->yield() (vendor/twig/twig/src/Template.php:344) at Twig\Template->display() (vendor/twig/twig/src/Template.php:359) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:51) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:334) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:220) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (vendor/symfony/framework-bundle/Controller/AbstractController.php:228) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render() (src/Controller/CatalogController.php:478) at App\Controller\CatalogController->prodList() (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/symfony/http-kernel/HttpCache/SubRequestHandler.php:86) at Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:457) at Symfony\Component\HttpKernel\HttpCache\HttpCache->forward() (vendor/symfony/framework-bundle/HttpCache/HttpCache.php:71) at Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache->forward() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:430) at Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:328) at Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup() (vendor/symfony/http-kernel/HttpCache/HttpCache.php:212) at Symfony\Component\HttpKernel\HttpCache\HttpCache->handle() (vendor/symfony/http-kernel/Kernel.php:193) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/home/mirbusin.ru/public_html/vendor/autoload_runtime.php') (public/index.php:5) |