Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

Neither the property "photo" nor one of the methods "photo()", "getphoto()"/"isphoto()"/"hasphoto()" or "__call()" exist and have public access in class "App\Services\Visimo\user".

Exception

Twig\Error\ RuntimeError

  1.     <div class="container-fluid px-0">
  2.       <div class="row g-0 align-items-center h-100">
  3.         <!-- Image -->
  4.         <div class="col-12 col-sm-4">
  5.       {% if mandate.user.photo %}
  6.           <figure>
  7.             <picture class="lazy">
  8.               <img src="https://www.visimo.fr/storage/users/1270_800/{{ mandate.user.photo }}" alt="Lorem ipsum" class="img-fluid h-400-px fit-image w-100"></data-img>
  9.             </picture>
  10.             <figcaption>© Visimo</figcaption>
  1.       <div class=\"row g-0 align-items-center h-100\">
  2.         <!-- Image -->
  3.         <div class=\"col-12 col-sm-4\">
  4.       ";
  5.         // line 626
  6.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["mandate"]) || array_key_exists("mandate"$context) ? $context["mandate"] : (function () { throw new RuntimeError('Variable "mandate" does not exist.'626$this->source); })()), "user", [], "any"falsefalsefalse626), "photo", [], "any"falsefalsefalse626)) {
  7.             // line 627
  8.             echo "          <figure>
  9.             <picture class=\"lazy\">
  10.               <img src=\"https://www.visimo.fr/storage/users/1270_800/";
  11.             // line 629
in vendor/twig/twig/src/Template.php -> block_body (line 171)
  1.             throw new \LogicException('A block must be a method on a \Twig\Template instance.');
  2.         }
  3.         if (null !== $template) {
  4.             try {
  5.                 $template->$block($context$blocks);
  6.             } catch (Error $e) {
  7.                 if (!$e->getSourceContext()) {
  8.                     $e->setSourceContext($template->getSourceContext());
  9.                 }
  1.         ";
  2.         // line 32
  3.         $this->displayBlock('menu'$context$blocks);
  4.         // line 169
  5.         echo "        ";
  6.         $this->displayBlock('body'$context$blocks);
  7.         // line 170
  8.         echo "        ";
  9.         $this->displayBlock('footer'$context$blocks);
  10.         // line 298
  11.         echo "    </body>
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
  1.         $macros $this->macros;
  2.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  3.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""mandate.html.twig"));
  4.         $this->parent $this->loadTemplate("base_white.html.twig""mandate.html.twig"1);
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  8.     }
in vendor/twig/twig/src/Template.php -> doDisplay (line 394)
  1.     }
  2.     protected function displayWithErrorHandling(array $context, array $blocks = [])
  3.     {
  4.         try {
  5.             $this->doDisplay($context$blocks);
  6.         } catch (Error $e) {
  7.             if (!$e->getSourceContext()) {
  8.                 $e->setSourceContext($this->getSourceContext());
  9.             }
in vendor/twig/twig/src/Template.php -> displayWithErrorHandling (line 367)
  1.         return $this->blocks;
  2.     }
  3.     public function display(array $context, array $blocks = [])
  4.     {
  5.         $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks$blocks));
  6.     }
  7.     public function render(array $context)
  8.     {
  9.         $level ob_get_level();
in vendor/twig/twig/src/Template.php -> display (line 379)
  1.             ob_start();
  2.         } else {
  3.             ob_start(function () { return ''; });
  4.         }
  5.         try {
  6.             $this->display($context);
  7.         } catch (\Throwable $e) {
  8.             while (ob_get_level() > $level) {
  9.                 ob_end_clean();
  10.             }
  1.     public function render(array $context = []): string
  2.     {
  3.         // using func_get_args() allows to not expose the blocks argument
  4.         // as it should only be used by internal code
  5.         return $this->template->render($context, \func_get_args()[1] ?? []);
  6.     }
  7.     public function display(array $context = [])
  8.     {
  9.         // using func_get_args() allows to not expose the blocks argument
  1.      * @throws SyntaxError  When an error occurred during compilation
  2.      * @throws RuntimeError When an error occurred during rendering
  3.      */
  4.     public function render($name, array $context = []): string
  5.     {
  6.         return $this->load($name)->render($context);
  7.     }
  8.     /**
  9.      * Displays a template.
  10.      *
  1.     {
  2.         if (!$this->container->has('twig')) {
  3.             throw new \LogicException('You can not use the "renderView" method if the Twig Bundle is not available. Try running "composer require symfony/twig-bundle".');
  4.         }
  5.         return $this->container->get('twig')->render($view$parameters);
  6.     }
  7.     /**
  8.      * Renders a view.
  9.      */
  1.     /**
  2.      * Renders a view.
  3.      */
  4.     protected function render(string $view, array $parameters = [], Response $response null): Response
  5.     {
  6.         $content $this->renderView($view$parameters);
  7.         if (null === $response) {
  8.             $response = new Response();
  9.         }
AbstractController->render() in src/Controller/RootController.php (line 127)
  1.     {
  2.         $mandate $this->visimoService->simplified->getMandate($id);
  3.         $menus $this->visimoService->getMenus();
  4.         $texts $this->visimoService->translations->getCurrentPage();
  5.         $area $this->visimoService->areas->getCurrentArea();
  6.         return $this->render('mandate.html.twig', ['mandate' => $mandate'menus' => $menus'googlemaps_key' => 'AIzaSyDxCcXapo0pEsJ8s15Zh_gUIvdN5-xN8ow''area_class' => $area['ar_class'], 'texts'=>$texts]);
  7.     }
  8.     /**
  9.      * @Route("/video/{id}", name="video")
  10.      */
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     public function handle(Request $requestint $type HttpKernelInterface::MAIN_REQUESTbool $catch true)
  2.     {
  3.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/visimo.fr/vhosts/www/visimo-website/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Logs

No log messages

Stack Trace

RuntimeError
Twig\Error\RuntimeError:
Neither the property "photo" nor one of the methods "photo()", "getphoto()"/"isphoto()"/"hasphoto()" or "__call()" exist and have public access in class "App\Services\Visimo\user".

  at templates/mandate.html.twig:626
  at twig_get_attribute()
     (var/cache/prod/twig/22/22162d29c3f818d03d14a455556b3535e622613021cdabd0cc128e5b24953a93.php:1698)
  at __TwigTemplate_6b93bd51fe7415847def2246b76441b892f86aa13dcb487dc84eacc3414a52e7->block_body()
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock()
     (var/cache/prod/twig/4b/4b176903e7f0e3e8e9a9034c0106c881bb637c6f792ea9760a509cfefd74f4dc.php:97)
  at __TwigTemplate_50d4ffaf9e9f5aba044087e1fc7176d12267d7133fc509e9d13668b5c3110255->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (var/cache/prod/twig/22/22162d29c3f818d03d14a455556b3535e622613021cdabd0cc128e5b24953a93.php:45)
  at __TwigTemplate_6b93bd51fe7415847def2246b76441b892f86aa13dcb487dc84eacc3414a52e7->doDisplay()
     (vendor/twig/twig/src/Template.php:394)
  at Twig\Template->displayWithErrorHandling()
     (vendor/twig/twig/src/Template.php:367)
  at Twig\Template->display()
     (vendor/twig/twig/src/Template.php:379)
  at Twig\Template->render()
     (vendor/twig/twig/src/TemplateWrapper.php:40)
  at Twig\TemplateWrapper->render()
     (vendor/twig/twig/src/Environment.php:277)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:251)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:259)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/RootController.php:127)
  at App\Controller\RootController->mandate()
     (vendor/symfony/http-kernel/HttpKernel.php:156)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:78)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:199)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:37)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/visimo.fr/vhosts/www/visimo-website/vendor/autoload_runtime.php')
     (public/index.php:5)