Exceptions
Exception
Twig\Error\ RuntimeError
Show exception properties
Twig\Error\RuntimeError {#891 -lineno: 16 -rawMessage: "Impossible to access an attribute ("products") on a null variable." -source: Twig\Source {#857 -code: """ {% extends 'base.html.twig' %}\n \n {% block title %}Hello HomeController!{% endblock %}\n \n {% block body %}\n {% include 'front/_inc/_header4.html.twig' %}\n {#<div class="card card-body blur shadow-blur ">#}\n <div class="card card-body bg-light-subtle blur shadow-blur mx-3 mx-md-4 mt-n6 pb-5">\n \n <div class="container">\n <div class="row">\n <div class="col-lg-7">\n <!-- START Blogs w/ 3 rows w/ image on left & title, text, author on end-->\n {# <section class="py-5">#}\n \n {% for p in category.products %}\n {% if p.isActivo %}\n <div class="card card-background-mask-dark mt-5 shadow shadow-lg border-warning-subtle border-2">\n {# <div class="card card-plain card-blog mt-5">#}\n <div class="row">\n <div class="col-lg-4 col-sm-6">\n <div class="card-image position-relative border-radius-lg">\n <div class="blur-shadow-image mx-sm-2">\n <a href="{{ path('app_product', {'slug': p.slug}) }}" class="text-dark">\n <img class="img border-radius-lg" src="{{ asset('uploads/products/'~p.imageName) | imagine_filter('normal') }}" alt="architecture" loading="lazy">\n </a>\n </div>\n {# <div class="colored-shadow" style="background-image: url({{ asset('img/pastics.jpg') }});"></div>#}\n </div>\n </div>\n <div class="col-lg-7 col-md-7 my-sm-auto mt-3 ms-sm-3 ps-md-5">\n <h4>\n <a href="{{ path('app_product', {'slug': p.slug}) }}" class="text-dark">{{ p }}</a>\n </h4>\n <p>\n {{ p.description|raw }}\n </p>\n <p>\n Read <a href="{{ path('app_product', {'slug': p.slug}) }}" class="link link-info"> More </a>\n </p>\n {# <div class="author">#}\n {# <img src="{{ asset('frontkit/assets/img/team-4.jpg') }}" alt="team-4" class="avatar avatar-sm shadow me-2 border-radius-lg" loading="lazy">#}\n {# <p class="my-auto">Katie Roof</p>#}\n {# </div>#}\n </div>\n </div>\n </div>\n {% endif %}\n {% endfor %}\n \n {# </section>#}\n <!-- END Blogs w/ 3 rows w/ image on left & title, text, author on end-->\n {# <div class="card card-blog card-background">#}\n {# <div class="full-background" style="background-image: url('https://images.unsplash.com/photo-1488901512066-cd403111aeb2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2378&q=80')" loading="lazy"></div>#}\n {# <div class="card-body body-left">#}\n {# <div class="content-left text-start">#}\n {# <h2 class="card-title text-white">Flexible office space means growing your team.</h2>#}\n {# <p class="card-description">Rather than worrying about switching offices every couple years, you can instead stay in the same location and grow-up from your shared coworking space to an office that takes up an entire floor.</p>#}\n {# <div class="author">#}\n {# <img src="{{ asset('frontkit/assets/img/team-2.jpg') }}" alt="..." class="avatar mr-2" loading="lazy">#}\n {# <div class="name ms-2">#}\n {# <span>Mathew Glock</span>#}\n {# <div class="stats">#}\n {# <small>Marketing Manager</small>#}\n {# </div>#}\n {# </div>#}\n {# </div>#}\n {# </div>#}\n {# </div>#}\n {# </div>#}\n \n </div>\n <div class="col-lg-4 ml-auto">\n <div class="pt-1 pb-5 position-sticky top-1 mt-lg-8 mt-5">\n <h4 class="mt-5">Categories</h4>\n \n {% for c in categories %}\n <div class="card card-plain card-blog mt-4">\n <div class="row">\n {# <div class="col-lg-4 col-md-4">#}\n {# <div class="card-image position-relative border-radius-lg">#}\n {# <div class="blur-shadow-image">#}\n {# <img class="img border-radius-lg" src="https://images.unsplash.com/photo-1559056199-641a0ac8b55e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80" alt="curved11" loading="lazy">#}\n {# </div>#}\n {# <div class="colored-shadow" style="background-image: url("https://images.unsplash.com/photo-1559056199-641a0ac8b55e?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80");"></div></div>#}\n {# </div>#}\n <div class="col-lg-8 col-md-8 my-sm-auto mt-3">\n <h5>\n <a href="{{ path('app_category', {'slug': c.slug}) }}" class="text-dark font-weight-normal">{{ c }}</a>\n </h5>\n </div>\n </div>\n </div>\n {% endfor %}\n \n {# <h4 class="mt-5 mb-4">Tags</h4>#}\n {# <span class="badge bg-light text-dark">Support</span>#}\n {# <span class="badge bg-light text-dark">Business</span>#}\n {# <span class="badge bg-light text-dark">Analytics</span>#}\n {# <span class="badge bg-light text-dark">Tutorials</span>#}\n {# <span class="badge bg-light text-dark mt-2">Sponsorships</span>#}\n </div>\n </div>\n </div>\n </div>\n </div>\n \n \n \n {% endblock %}\n """ -name: "home/category.html.twig" -path: "/home/salsindu1621/templates/home/category.html.twig" } -phpFile: "/home/salsindu1621/vendor/twig/twig/src/Extension/CoreExtension.php" -phpLine: 1743 }
in
templates/home/category.html.twig
(line 16)
<div class="row"><div class="col-lg-7"><!-- START Blogs w/ 3 rows w/ image on left & title, text, author on end-->{# <section class="py-5">#}{% for p in category.products %}{% if p.isActivo %}<div class="card card-background-mask-dark mt-5 shadow shadow-lg border-warning-subtle border-2">{# <div class="card card-plain card-blog mt-5">#}<div class="row"><div class="col-lg-4 col-sm-6">
in
var/cache/dev/twig/9b/9bce22b64e979f972a3574f48697f413.php
::
getAttribute
(line 114)
// line 15yield "";// line 16$context['_parent'] = $context;$context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 16, $this->source); })()), "products", [], "any", false, false, false, 16));foreach ($context['_seq'] as $context["_key"] => $context["p"]) {// line 17yield " ";if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["p"], "isActivo", [], "any", false, false, false, 17)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {// line 18
in
vendor/twig/twig/src/Template.php
->
block_body
(line 446)
throw new \LogicException('A block must be a method on a \Twig\Template instance.');}if (null !== $template) {try {yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/50/503b88b22e502cfe3177f602fa39cf71.php
->
yieldBlock
(line 127)
yield from $this->load("front/_inc/_navbar3.html.twig", 112)->unwrap()->yield($context);// line 113yield "";// line 114yield from $this->unwrap()->yieldBlock('body', $context, $blocks);// line 115yield "";// line 116yield from $this->load("front/_inc/_footer2.html.twig", 116)->unwrap()->yield($context);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 402)
{$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/9b/9bce22b64e979f972a3574f48697f413.php
->
yield
(line 54)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "home/category.html.twig"));$this->parent = $this->load("base.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 402)
{$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 358)
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 373)
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 333)
* @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 462)
if (null !== $block) {return $this->container->get('twig')->load($view)->renderBlock($block, $parameters);}return $this->container->get('twig')->render($view, $parameters);}private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response{$content = $this->doRenderView($view, $block, $parameters, $method);
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
doRenderView
(line 467)
return $this->container->get('twig')->render($view, $parameters);}private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response{$content = $this->doRenderView($view, $block, $parameters, $method);$response ??= new Response();if (200 === $response->getStatusCode()) {foreach ($parameters as $v) {if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) {
in
vendor/symfony/framework-bundle/Controller/AbstractController.php
->
doRender
(line 279)
* If an invalid form is found in the list of parameters, a 422 status code is returned.* Forms found in parameters are auto-cast to form views.*/protected function render(string $view, array $parameters = [], ?Response $response = null): Response{return $this->doRender($view, null, $parameters, $response, __FUNCTION__);}/*** Renders a block in a view.*
public function category(string $slug): Response{$category = $this->em->getRepository(Category::class)->findOneBy(['slug' => $slug]);$categories = $this->em->getRepository(Category::class)->findBy(['isActive' => true],['orden' => 'ASC']);return $this->render('home/category.html.twig', ['controller_name' => 'HomeController','category' => $category,'categories' => $categories]);}
in
vendor/symfony/http-kernel/HttpKernel.php
->
category
(line 183)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$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;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 191)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
) {}public function run(): int{$response = $this->kernel->handle($this->request);if (Kernel::VERSION_ID >= 60400) {$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 13:43:12 | deprecation |
User Deprecated: The Liip\ImagineBundle\Templating\FilterTrait trait is deprecated since version 2.7 and will be removed in 3.0; use Twig instead. {
"exception": {}
}
|
| INFO 13:43:12 | deprecation |
User Deprecated: The Liip\ImagineBundle\Templating\FilterExtension class is deprecated since version 2.7 and will be removed in 3.0; configure "liip_imagine.twig.mode" to "lazy" instead. {
"exception": {}
}
|
| INFO 13:43:12 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "7e1b02"
},
"request_uri": "https://www.salsindustrial.com/_profiler/7e1b02",
"method": "GET"
}
|
Stack Trace
|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Impossible to access an attribute ("products") on a null variable in "home/category.html.twig" at line 16.
at templates/home/category.html.twig:16
at Twig\Extension\CoreExtension::getAttribute()
(var/cache/dev/twig/9b/9bce22b64e979f972a3574f48697f413.php:114)
at __TwigTemplate_99cd43fc1b79f13042a023692fd14964->block_body()
(vendor/twig/twig/src/Template.php:446)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/50/503b88b22e502cfe3177f602fa39cf71.php:127)
at __TwigTemplate_ec5c59461106973c69cfe9a09a047d8f->doDisplay()
(vendor/twig/twig/src/Template.php:402)
at Twig\Template->yield()
(var/cache/dev/twig/9b/9bce22b64e979f972a3574f48697f413.php:54)
at __TwigTemplate_99cd43fc1b79f13042a023692fd14964->doDisplay()
(vendor/twig/twig/src/Template.php:402)
at Twig\Template->yield()
(vendor/twig/twig/src/Template.php:358)
at Twig\Template->display()
(vendor/twig/twig/src/Template.php:373)
at Twig\Template->render()
(vendor/twig/twig/src/TemplateWrapper.php:51)
at Twig\TemplateWrapper->render()
(vendor/twig/twig/src/Environment.php:333)
at Twig\Environment->render()
(vendor/symfony/framework-bundle/Controller/AbstractController.php:462)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRenderView()
(vendor/symfony/framework-bundle/Controller/AbstractController.php:467)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRender()
(vendor/symfony/framework-bundle/Controller/AbstractController.php:279)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
(src/Controller/HomeController.php:44)
at App\Controller\HomeController->category()
(vendor/symfony/http-kernel/HttpKernel.php:183)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:191)
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:32)
at require_once('/home/salsindu1621/vendor/autoload_runtime.php')
(public_html/index.php:5)
|