Exceptions
Exception
Twig\Error\ RuntimeError
Show exception properties
Twig\Error\RuntimeError {#2739 -lineno: 7 -columnno: null -rawMessage: "Impossible to access an attribute ("firstname") on a null variable." -source: Twig\Source {#1237 -code: """ {% extends '@EasyAdmin/page/content.html.twig' %}\n \n {% block content_title %}{{ 'dashboard.title'|trans }}{% endblock %}\n \n {% block main %}\n <p class="text-muted mb-4">\n {{ 'dashboard.greeting'|trans({'%firstname%': user.firstname}) }}\n </p>\n \n <div class="row g-3 mb-4">\n <div class="col-md-3">\n <a href="{{ ea_url().setController('App\\Controller\\Admin\\RestaurantCrudController') }}" class="text-decoration-none">\n <div class="card h-100 shadow-sm">\n <div class="card-body text-center">\n <i class="fa fa-store fa-2x mb-2 text-primary"></i>\n <h6 class="card-title mb-0">{{ 'dashboard.shortcuts.restaurant'|trans }}</h6>\n </div>\n </div>\n </a>\n </div>\n <div class="col-md-3">\n <a href="{{ ea_url().setController('App\\Controller\\Admin\\FoodItemCrudController') }}" class="text-decoration-none">\n <div class="card h-100 shadow-sm">\n <div class="card-body text-center">\n <i class="fa fa-utensils fa-2x mb-2 text-primary"></i>\n <h6 class="card-title mb-0">{{ 'dashboard.shortcuts.food_items'|trans }}</h6>\n <small class="text-muted">{{ 'dashboard.counts.food_item'|trans({'%count%': counts.food_items}) }}</small>\n </div>\n </div>\n </a>\n </div>\n <div class="col-md-3">\n <a href="{{ ea_url().setController('App\\Controller\\Admin\\DrinkCrudController') }}" class="text-decoration-none">\n <div class="card h-100 shadow-sm">\n <div class="card-body text-center">\n <i class="fa fa-wine-glass fa-2x mb-2 text-primary"></i>\n <h6 class="card-title mb-0">{{ 'dashboard.shortcuts.drinks'|trans }}</h6>\n <small class="text-muted">{{ 'dashboard.counts.drink'|trans({'%count%': counts.drinks}) }}</small>\n </div>\n </div>\n </a>\n </div>\n <div class="col-md-3">\n <a href="{{ ea_url().setController('App\\Controller\\Admin\\MenuCrudController') }}" class="text-decoration-none">\n <div class="card h-100 shadow-sm">\n <div class="card-body text-center">\n <i class="fa fa-book-open fa-2x mb-2 text-primary"></i>\n <h6 class="card-title mb-0">{{ 'dashboard.shortcuts.menus'|trans }}</h6>\n <small class="text-muted">{{ 'dashboard.counts.menu'|trans({'%count%': counts.menus}) }}</small>\n </div>\n </div>\n </a>\n </div>\n </div>\n \n <div class="card shadow-sm">\n <div class="card-header">\n <strong>{{ 'dashboard.config_status.title'|trans }}</strong>\n </div>\n <ul class="list-group list-group-flush">\n {% for check in checks %}\n <li class="list-group-item d-flex align-items-center">\n {% if check.ok %}\n <i class="fa fa-check-circle text-success me-2"></i>\n {% else %}\n <i class="fa fa-exclamation-triangle text-warning me-2"></i>\n {% endif %}\n <span class="{{ check.ok ? '' : 'text-muted' }}">{{ check.label|trans }}</span>\n {% if not check.ok and check.editUrl %}\n <a href="{{ check.editUrl }}" class="ms-auto btn btn-sm btn-outline-primary">Configurer</a>\n {% endif %}\n </li>\n {% endfor %}\n </ul>\n </div>\n {% endblock %}\n """ -name: "bundles/dashboard.html.twig" -path: "/var/www/admin-a-la-carte/templates/bundles/dashboard.html.twig" } -phpFile: "/var/www/admin-a-la-carte/vendor/twig/twig/src/Extension/CoreExtension.php" -phpLine: 1759 }
in
templates/bundles/dashboard.html.twig
(line 7)
{% block content_title %}{{ 'dashboard.title'|trans }}{% endblock %}{% block main %}<p class="text-muted mb-4">{{ 'dashboard.greeting'|trans({'%firstname%': user.firstname}) }}</p><div class="row g-3 mb-4"><div class="col-md-3"><a href="{{ ea_url().setController('App\\Controller\\Admin\\RestaurantCrudController') }}" class="text-decoration-none">
in
var/cache/dev/twig/4a/4a1bb7dd7dccf0e48f8fa94d67eed675.php
::
getAttribute
(line 104)
// line 6yield " <p class=\"text-muted mb-4\">";// line 7yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("dashboard.greeting", ["%firstname%" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["user"]) || array_key_exists("user", $context) ? $context["user"] : (function () { throw new RuntimeError('Variable "user" does not exist.', 7, $this->source); })()), "firstname", [], "any", false, false, false, 7)]), "html", null, true);yield "</p><div class=\"row g-3 mb-4\"><div class=\"col-md-3\">
in
vendor/twig/twig/src/Template.php
->
block_main
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 1968)
// line 420yield "<section id=\"main\" class=\"content-body\">";// line 422yield from $this->unwrap()->yieldBlock('main', $context, $blocks);// line 423yield " </section>";// line 425
in
vendor/twig/twig/src/Template.php
->
block_content
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 1457)
yield " </aside><div class=\"content-wrapper\">";// line 393yield from $this->unwrap()->yieldBlock('content', $context, $blocks);// line 434yield "<div id=\"content-resizer-handler\" class=\"resizer-handler resizer-handler-right\"></div></div></section>
in
vendor/twig/twig/src/Template.php
->
block_main_content_wrapper
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 1101)
}// line 292yield " </div>";// line 293yield from $this->unwrap()->yieldBlock('main_content_wrapper', $context, $blocks);// line 439yield " ";$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
in
vendor/twig/twig/src/Template.php
->
block_wrapper
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 884)
// line 215yield "<div class=\"wrapper\">";// line 217yield from $this->unwrap()->yieldBlock('wrapper', $context, $blocks);// line 440yield " </div>";$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
in
vendor/twig/twig/src/Template.php
->
block_wrapper_wrapper
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 614)
yield from $this->unwrap()->yieldBlock('javascript_page_color_scheme', $context, $blocks);// line 124yield "";// line 125yield from $this->unwrap()->yieldBlock('wrapper_wrapper', $context, $blocks);// line 442yield "";// line 443yield from $this->unwrap()->yieldBlock('body_javascript', $context, $blocks);
in
vendor/twig/twig/src/Template.php
->
block_body
(line 458)
}if (null !== $template) {try {$template->ensureSecurityChecked();yield from $template->$block($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($template->getSourceContext());}
in
var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php
->
yieldBlock
(line 169)
// line 97yield "</head>";// line 99yield from $this->unwrap()->yieldBlock('body', $context, $blocks);// line 452yield "</html>";$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
in
vendor/twig/twig/src/Template.php
->
doDisplay
(line 411)
$context += $this->env->getGlobals();$blocks = array_merge($this->blocks, $blocks);try {$this->ensureSecurityChecked();yield from $this->doDisplay($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($this->getSourceContext());}
in
var/cache/dev/twig/e1/e10bed885495872788598fa4d563df11.php
->
yield
(line 58)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@EasyAdmin/page/content.html.twig"));// line 6$context["__internal_trans_default_domaincfe879b3cfb936ace1964ee94778d33b"] = (( !(null === $this->extensions['EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension']->ea())) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $this->extensions['EasyCorp\Bundle\EasyAdminBundle\Twig\EasyAdminTwigExtension']->ea(), "i18n", [], "any", false, false, false, 6), "translationDomain", [], "any", false, false, false, 6)) : (((array_key_exists("translation_domain", $context)) ? ((((array_key_exists("translation_domain", $context) && !(null === $context["translation_domain"]))) ? ($context["translation_domain"]) : ("messages"))) : (""))));// line 5yield from $this->getParent($context)->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 411)
$context += $this->env->getGlobals();$blocks = array_merge($this->blocks, $blocks);try {$this->ensureSecurityChecked();yield from $this->doDisplay($context, $blocks);} catch (Error $e) {if (!$e->getSourceContext()) {$e->setSourceContext($this->getSourceContext());}
in
var/cache/dev/twig/4a/4a1bb7dd7dccf0e48f8fa94d67eed675.php
->
yield
(line 55)
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "bundles/dashboard.html.twig"));$this->parent = $this->load("@EasyAdmin/page/content.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 411)
$context += $this->env->getGlobals();$blocks = array_merge($this->blocks, $blocks);try {$this->ensureSecurityChecked();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 366)
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 381)
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.*
/** @var User|null $user */$user = $this->getUser();$restaurant = $this->entityManager->getRepository(Restaurant::class)->findOneBy([]);return $this->render('bundles/dashboard.html.twig', ['user' => $user,'counts' => ['food_items' => $this->entityManager->getRepository(FoodItem::class)->count([]),'drinks' => $this->entityManager->getRepository(Drink::class)->count([]),'menus' => $this->entityManager->getRepository(Menu::class)->count([]),
in
vendor/symfony/http-kernel/HttpKernel.php
->
index
(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 34)
) {}public function run(): int{$response = $this->kernel->handle($this->request);$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {fastcgi_finish_request();
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 static function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 23:37:04 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "9a2066"
},
"request_uri": "https://admin-a-la-carte.wevoria.com/_profiler/9a2066?panel=exception&type=request",
"method": "GET"
}
|
Stack Trace
|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Impossible to access an attribute ("firstname") on a null variable in "bundles/dashboard.html.twig" at line 7.
at templates/bundles/dashboard.html.twig:7
at Twig\Extension\CoreExtension::getAttribute()
(var/cache/dev/twig/4a/4a1bb7dd7dccf0e48f8fa94d67eed675.php:104)
at __TwigTemplate_e06b8e6bdc56e1e8bc23d5d05b778bdb->block_main()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:1968)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->block_content()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:1457)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->block_main_content_wrapper()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:1101)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->block_wrapper()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:884)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->block_wrapper_wrapper()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:614)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->block_body()
(vendor/twig/twig/src/Template.php:458)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/b8/b8b4b5be7b152a241d8a612198866c74.php:169)
at __TwigTemplate_1f2553e0c267ab4e0bf703c4710517dc->doDisplay()
(vendor/twig/twig/src/Template.php:411)
at Twig\Template->yield()
(var/cache/dev/twig/e1/e10bed885495872788598fa4d563df11.php:58)
at __TwigTemplate_cf5acc8d79e813b25a325235b219bc67->doDisplay()
(vendor/twig/twig/src/Template.php:411)
at Twig\Template->yield()
(var/cache/dev/twig/4a/4a1bb7dd7dccf0e48f8fa94d67eed675.php:55)
at __TwigTemplate_e06b8e6bdc56e1e8bc23d5d05b778bdb->doDisplay()
(vendor/twig/twig/src/Template.php:411)
at Twig\Template->yield()
(vendor/twig/twig/src/Template.php:366)
at Twig\Template->display()
(vendor/twig/twig/src/Template.php:381)
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/Admin/DashboardController.php:98)
at App\Controller\Admin\DashboardController->index()
(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:34)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/admin-a-la-carte/vendor/autoload_runtime.php')
(public/index.php:5)
|