Exceptions
Exception
Twig\Error\ RuntimeError
Show exception properties
Twig\Error\RuntimeError {#530 -lineno: 21 -rawMessage: "Impossible to access an attribute ("ruches") on a null variable." -source: Twig\Source {#487 -code: """ {% extends 'base.html.twig' %}\n \n {% block title %}Ruche index{% endblock %}\n \n {% block body %}\n <div class="fancy-tab-container app-page-shell" id="ruche-page-shell">\n <ul class="nav nav-tabs fancy one-tab" role="tablist">\n <li class="nav-item" role="presentation">\n <a class="nav-link active" href="#ruche-page-content" data-bs-toggle="tab" role="tab" aria-selected="true">Ruche</a>\n </li>\n </ul>\n <div class="tab-content printable">\n <div class="tab-pane fade show active" id="ruche-page-content" role="tabpanel">\n {% block content %}\n <div class="page-shell-header">\n <h1>Ruche</h1>\n <p class="text-muted mb-0">Consultez vos ruches enregistrées et créez de nouveaux calculs de compatibilité.</p>\n </div>\n \n <div class="alert alert-light border">\n Vous avez <strong>{{ app.user.ruches|length }}</strong> ruche(s) enregistrée(s).\n <a class="btn btn-primary btn-sm ms-2" href="{{ path('ruche_all_by_user', { id: app.user.id }) }}">Voir votre liste</a>\n </div>\n \n {% if payment_actived == 'true' and app.user.quota > 1 %}\n <div class="alert alert-info mb-0">\n <p class="mb-2">Il vous reste actuellement <strong>{{ app.user.quota }}</strong> référentiel(s) à utiliser.</p>\n <div class="page-shell-actions mt-0">\n <a class="btn btn-primary" href="{{ path('ruche_new') }}">Créer une ruche</a>\n </div>\n </div>\n {% elseif payment_actived == 'true' and app.user.quota == 1 %}\n <div class="alert alert-warning mb-0">\n <p class="mb-2">Il ne vous reste plus qu'un référentiel ou une ruche à utiliser.</p>\n <div class="page-shell-actions mt-0">\n <a class="btn btn-primary" href="{{ path('ruche_new') }}">Créer une ruche</a>\n <a class="btn btn-outline-primary" href="{{ path('tarifs') }}">Commander</a>\n </div>\n </div>\n {% elseif payment_actived == 'false' or app.user.quota == -1 %}\n <div class="page-shell-actions mt-0">\n <a class="btn btn-primary" href="{{ path('ruche_new') }}">Créer une ruche</a>\n </div>\n {% else %}\n <div class="alert alert-danger mb-0">\n <p class="mb-2">Il ne vous reste plus de référentiel à utiliser.</p>\n <div class="page-shell-actions mt-0">\n <a class="btn btn-primary" href="{{ path('tarifs') }}">Commander</a>\n </div>\n </div>\n {% endif %}\n {% endblock %}\n </div>\n </div>\n </div>\n {% endblock %}\n \n """ -name: "ruche/index.html.twig" -path: "/var/www/newredena/templates/ruche/index.html.twig" } -phpFile: "/var/www/newredena/vendor/twig/twig/src/Extension/CoreExtension.php" -phpLine: 1749 }
in
templates/ruche/index.html.twig
(line 21)
<h1>Ruche</h1><p class="text-muted mb-0">Consultez vos ruches enregistrées et créez de nouveaux calculs de compatibilité.</p></div><div class="alert alert-light border">Vous avez <strong>{{ app.user.ruches|length }}</strong> ruche(s) enregistrée(s).<a class="btn btn-primary btn-sm ms-2" href="{{ path('ruche_all_by_user', { id: app.user.id }) }}">Voir votre liste</a></div>{% if payment_actived == 'true' and app.user.quota > 1 %}<div class="alert alert-info mb-0">
in
var/cache/dev/twig/86/8692cf845b7a2bdcea859a40f18476c6.php
::
getAttribute
(line 148)
</div><div class=\"alert alert-light border\">Vous avez <strong>";// line 21yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 21, $this->source); })()), "user", [], "any", false, false, false, 21), "ruches", [], "any", false, false, false, 21)), "html", null, true);yield "</strong> ruche(s) enregistrée(s).<a class=\"btn btn-primary btn-sm ms-2\" href=\"";// line 22yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("ruche_all_by_user", ["id" => CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 22, $this->source); })()), "user", [], "any", false, false, false, 22), "id", [], "any", false, false, false, 22)]), "html", null, true);yield "\">Voir votre liste</a>
in
vendor/twig/twig/src/Template.php
->
block_content
(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/86/8692cf845b7a2bdcea859a40f18476c6.php
->
yieldBlock
(line 111)
</ul><div class=\"tab-content printable\"><div class=\"tab-pane fade show active\" id=\"ruche-page-content\" role=\"tabpanel\">";// line 14yield from $this->unwrap()->yieldBlock('content', $context, $blocks);// line 53yield " </div></div></div>";
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/9c/9ca72b896ac9977790a8fb0f87277eb6.php
->
yieldBlock
(line 81)
// line 16yield "<main class=\"container-fluid py-3 mb-5\">";// line 18yield from $this->unwrap()->yieldBlock('body', $context, $blocks);// line 19yield "</main><footer class=\"fixed-bottom bg-white border-top py-2\"><div class=\"container\">
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/86/8692cf845b7a2bdcea859a40f18476c6.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", "ruche/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.*
final class RucheController extends AbstractController{#[Route(name: 'ruche_index', methods: ['GET'])]public function index(): Response{return $this->render('ruche/index.html.twig');}#[Route('/all', name: 'ruche_all', methods: ['GET'])]public function allAction(RucheRepository $rucheRepository): Response{
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 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): Kernel {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 11:44:17 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "c344d2"
},
"request_uri": "https://newredena.planeef.fr/_profiler/c344d2?panel=exception&type=request",
"method": "GET"
}
|
Stack Trace
|
RuntimeError
|
|---|
Twig\Error\RuntimeError:
Impossible to access an attribute ("ruches") on a null variable in "ruche/index.html.twig" at line 21.
at templates/ruche/index.html.twig:21
at Twig\Extension\CoreExtension::getAttribute()
(var/cache/dev/twig/86/8692cf845b7a2bdcea859a40f18476c6.php:148)
at __TwigTemplate_588323eb439f972e8f2c665678fa9805->block_content()
(vendor/twig/twig/src/Template.php:446)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/86/8692cf845b7a2bdcea859a40f18476c6.php:111)
at __TwigTemplate_588323eb439f972e8f2c665678fa9805->block_body()
(vendor/twig/twig/src/Template.php:446)
at Twig\Template->yieldBlock()
(var/cache/dev/twig/9c/9ca72b896ac9977790a8fb0f87277eb6.php:81)
at __TwigTemplate_7e33cfaf1860c2b092ef99173532db84->doDisplay()
(vendor/twig/twig/src/Template.php:402)
at Twig\Template->yield()
(var/cache/dev/twig/86/8692cf845b7a2bdcea859a40f18476c6.php:55)
at __TwigTemplate_588323eb439f972e8f2c665678fa9805->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/RucheController.php:22)
at App\Controller\RucheController->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:35)
at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
(vendor/autoload_runtime.php:32)
at require_once('/var/www/newredena/vendor/autoload_runtime.php')
(public/index.php:5)
|