Exceptions
Exceptions 2
Twig\Error\ RuntimeError
{% if app.request.locale|slice(0, 2) == 'en' %}
<link rel="alternate" hreflang="en" href="{{ app.request.uri }}" />
<link rel="alternate" hreflang="fr-fr" href="{{ app.request.getSchemeAndHttpHost() }}/{{ app_hreflang('en', app.request.pathInfo, app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" />
{% else %}
<link rel="alternate" hreflang="en" href="{{ app.request.getSchemeAndHttpHost() }}/{{ app_hreflang('fr-fr', app.request.pathInfo, app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" />
<link rel="alternate" hreflang="fr-fr" href="{{ app.request.uri }}" />
{% endif %}
{% if app.session.get('on_login') is defined and app.session.get('on_login') == true %}
in
vendor/twig/twig/src/Template.php
->
displayWithErrorHandling
(line 378)
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
in
vendor/twig/twig/src/Environment.php(418) : eval()'d code
->
display
(line 56)
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 405)
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
displayWithErrorHandling
(line 378)
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
in
vendor/twig/twig/src/Template.php
->
display
(line 390)
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 45)
*/
public function render(array $context = []): string
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
}
/**
* Displays the template.
*
in
vendor/twig/twig/src/Environment.php
->
render
(line 318)
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = [])
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
render
(line 258)
{
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 266)
/**
* 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();
}
'meter' => $meter,
'isTissu' => $tissu,
'isCarteKdo' => $carteKdo,
'userFavoriteShopStock' => $userFavoriteShopStock
]);
}
public function accessoriesAjaxAction(
Request $request,
in
vendor/symfony/http-kernel/HttpKernel.php
->
showAction
(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;
}
}
$_SERVER['HTTPS'] = 'on';
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
ErrorException
in
src/Twig/TwigExtension.php
(line 797)
'locale' => $locale_inverse,
]);
$result = $resultSet->fetchAllAssociative();
$url = "p/".$result[0]['slug'].'-'.$params['id'];
break;
case 'sylius_shop_product_index':
in
vendor/twig/twig/src/Environment.php(418) : eval()'d code
->
getHreflang
(line 127)
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 405)
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
displayWithErrorHandling
(line 378)
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
in
vendor/twig/twig/src/Environment.php(418) : eval()'d code
->
display
(line 56)
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 405)
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
in
vendor/twig/twig/src/Template.php
->
displayWithErrorHandling
(line 378)
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
in
vendor/twig/twig/src/Template.php
->
display
(line 390)
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 45)
*/
public function render(array $context = []): string
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_get_args()[1] ?? []);
}
/**
* Displays the template.
*
in
vendor/twig/twig/src/Environment.php
->
render
(line 318)
* @throws SyntaxError When an error occurred during compilation
* @throws RuntimeError When an error occurred during rendering
*/
public function render($name, array $context = [])
{
return $this->load($name)->render($context);
}
/**
* Displays a template.
*
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
render
(line 258)
{
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 266)
/**
* 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();
}
'meter' => $meter,
'isTissu' => $tissu,
'isCarteKdo' => $carteKdo,
'userFavoriteShopStock' => $userFavoriteShopStock
]);
}
public function accessoriesAjaxAction(
Request $request,
in
vendor/symfony/http-kernel/HttpKernel.php
->
showAction
(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;
}
}
$_SERVER['HTTPS'] = 'on';
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Logs
No log messages
Stack Traces 2
[2/2]
RuntimeError
|
---|
Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Warning: Undefined array key 0"). at themes/webapicTheme/templates/bundles/SyliusShopBundle/layout.html.twig:101 at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:378) at Twig\Template->display() (vendor/twig/twig/src/Environment.php(418) : eval()'d code:56) at __TwigTemplate_80d8f2407e438e920a61630beacbdd16dd08ea6d28efb6fa15c749f063c94b5b->doDisplay() (vendor/twig/twig/src/Template.php:405) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:378) at Twig\Template->display() (vendor/twig/twig/src/Template.php:390) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:45) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:318) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:258) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (vendor/symfony/framework-bundle/Controller/AbstractController.php:266) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render() (src/Controller/ProductController.php:310) at App\Controller\ProductController->showAction() (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() (public/index.php:31) |
[1/2]
ErrorException
|
---|
ErrorException: Warning: Undefined array key 0 at src/Twig/TwigExtension.php:797 at App\Twig\TwigExtension->getHreflang() (vendor/twig/twig/src/Environment.php(418) : eval()'d code:127) at __TwigTemplate_a7c51692e4192b84cd0657536425ac82c19c19e804357f2d19f6de3526505e61->doDisplay() (vendor/twig/twig/src/Template.php:405) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:378) at Twig\Template->display() (vendor/twig/twig/src/Environment.php(418) : eval()'d code:56) at __TwigTemplate_80d8f2407e438e920a61630beacbdd16dd08ea6d28efb6fa15c749f063c94b5b->doDisplay() (vendor/twig/twig/src/Template.php:405) at Twig\Template->displayWithErrorHandling() (vendor/twig/twig/src/Template.php:378) at Twig\Template->display() (vendor/twig/twig/src/Template.php:390) at Twig\Template->render() (vendor/twig/twig/src/TemplateWrapper.php:45) at Twig\TemplateWrapper->render() (vendor/twig/twig/src/Environment.php:318) at Twig\Environment->render() (vendor/symfony/framework-bundle/Controller/AbstractController.php:258) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView() (vendor/symfony/framework-bundle/Controller/AbstractController.php:266) at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render() (src/Controller/ProductController.php:310) at App\Controller\ProductController->showAction() (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() (public/index.php:31) |