Exceptions
Exception
Twig\Error\ RuntimeError
Show exception properties
Twig\Error\RuntimeError {#1233 -lineno: 24 -rawMessage: "Impossible to access an attribute ("name") on a null variable." -source: Twig\Source {#1097 -code: """ {% extends 'base.html.twig' %}\n \n {% block title %}Legal Vote{% endblock %}\n \n {% block body %}\n <div class="container-fluid">\n {% block hero %}\n {{ include("sections/hero.html.twig") }}\n {% endblock %} \n {% block jaargids %}\n {{ include("sections/jaargids.html.twig") }}\n {% endblock %}\n <div class="row top-five">\n {% block topfive %}\n {{ include("sections/top-five.html.twig") }}\n {% endblock %}\n </div>\n <div class="row vote" id="votes">\n <div class="col-md-12 p-3">\n <a href="{{ path('app_home') }}#votes" type="button" class="btn btn-primary my-5">terug</a>\n {% for medium in media %}\n <h2>{{ medium.name }} - <img width="20%" src="{{ asset('uploads/images/' ~ medium.getImage())}}">\n \n - {{ categoryMedium.name }}\n \n </h2><hr>\n {% endfor %} \n {% block vote %}\n {{ include("sections/items.html.twig") }}\n {% endblock %}\n </div>\n </div>\n </div>\n \n {% endblock %} """ -name: "/category/index.html.twig" -path: "/home/charisma/domains/charismavote.com/public_html/templates/category/index.html.twig" } -phpFile: "/home/charisma/domains/charismavote.com/public_html/vendor/twig/twig/src/Extension/CoreExtension.php" -phpLine: 1749 }
in
templates/category/index.html.twig
(line 24)
<div class="col-md-12 p-3"><a href="{{ path('app_home') }}#votes" type="button" class="btn btn-primary my-5">terug</a>{% for medium in media %}<h2>{{ medium.name }} - <img width="20%" src="{{ asset('uploads/images/' ~ medium.getImage())}}">- {{ categoryMedium.name }}</h2><hr>{% endfor %}{% block vote %}{{ include("sections/items.html.twig") }}
in
var/cache/dev/twig/95/95f880f3d8acda5265531167aeec6864.php
::
getAttribute
(line 140)
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(("uploads/images/" . CoreExtension::getAttribute($this->env, $this->source, $context["medium"], "getImage", [], "method", false, false, false, 22))), "html", null, true);yield "\">- ";// line 24yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["categoryMedium"]) || array_key_exists("categoryMedium", $context) ? $context["categoryMedium"] : (function () { throw new RuntimeError('Variable "categoryMedium" does not exist.', 24, $this->source); })()), "name", [], "any", false, false, false, 24), "html", null, true);yield "</h2><hr>";}
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/64/64e958bc8faf768f17b85cfb5826efcd.php
->
yieldBlock
(line 80)
$context = array_intersect_key($context, $_parent) + $_parent;// line 10yield "";// line 11yield from $this->unwrap()->yieldBlock('body', $context, $blocks);// line 12yield "";// line 13yield from $this->unwrap()->yieldBlock('footer', $context, $blocks);
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/95/95f880f3d8acda5265531167aeec6864.php
->
yield
(line 58)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "/category/index.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(static 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 467)
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 472)
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 284)
* 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.*
$topFive = $itemRepository->listTopFive();$categoryMedium = $categoryRepository->findOneByCategoryId($category);// dd($categoryMedium);//dd($items);return $this->render('/category/index.html.twig', ['items' => $items,'media' => $media,'categoryMedium' => $categoryMedium,'topFive' => $topFive,]);
in
vendor/symfony/http-kernel/HttpKernel.php
->
mediaCategory
(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 193)
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());
require_once('/home/charisma/domains/charismavote.com/public_html/vendor/autoload_runtime.php')
in
public/index.php
(line 5)
<?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 |
|---|---|---|
| DEBUG 00:17:56 | php |
Warning: Zend OPcache API is restricted by "restrict_api" configuration directive {
"exception": {
"severity": 2,
"file": "/home/charisma/domains/charismavote.com/public_html/vendor/symfony/error-handler/DebugClassLoader.php",
"line": 318,
"trace": [
{
"file": "/home/charisma/domains/charismavote.com/public_html/vendor/doctrine/doctrine-bundle/src/DoctrineBundle.php",
"line": 136,
"function": "loadClass",
"class": "Symfony\\Component\\ErrorHandler\\DebugClassLoader",
"type": "->"
}
],
"count": 45
}
}
|
| INFO 00:17:56 | deprecation |
User Deprecated: Class "Doctrine\ORM\Proxy\Autoloader" is deprecated. Use native lazy objects instead. (Autoloader.php:74 called by DoctrineBundle.php:136, https://github.com/doctrine/orm/pull/12005, package doctrine/orm) {
"exception": {}
}
|
| INFO 00:17:56 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "e1959b"
},
"request_uri": "https://charismavote.com/_profiler/e1959b",
"method": "GET"
}
|
| INFO 00:17:56 | deprecation |
User Deprecated: Support for MySQL < 8 is deprecated and will be removed in DBAL 5 (AbstractMySQLDriver.php:75 called by AbstractDriverMiddleware.php:32, https://github.com/doctrine/dbal/pull/6343, package doctrine/dbal) {
"exception": {}
}
|
Stack Trace
|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Impossible to access an attribute ("name") on a null variable in "/category/index.html.twig" at line 24.
at templates/category/index.html.twig:24
at Twig\Extension\CoreExtension::getAttribute()
(var/cache/dev/twig/95/95f880f3d8acda5265531167aeec6864.php:140)
at __TwigTemplate_f8041e10b186173a230aedc7e6a29868->block_body()
(vendor/twig/twig/src/Template.php:446)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/64/64e958bc8faf768f17b85cfb5826efcd.php:80)
at __TwigTemplate_462ca196cfe8556e0dfb3b9308d5bd1d->doDisplay()
(vendor/twig/twig/src/Template.php:402)
at Twig\Template->yield()
(var/cache/dev/twig/95/95f880f3d8acda5265531167aeec6864.php:58)
at __TwigTemplate_f8041e10b186173a230aedc7e6a29868->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:467)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRenderView()
(vendor/symfony/framework-bundle/Controller/AbstractController.php:472)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRender()
(vendor/symfony/framework-bundle/Controller/AbstractController.php:284)
at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
(src/Controller/HomeController.php:65)
at App\Controller\HomeController->mediaCategory()
(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: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:32)
at require_once('/home/charisma/domains/charismavote.com/public_html/vendor/autoload_runtime.php')
(public/index.php:5)
|