Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

Impossible to access an attribute ("livingStatus") on a boolean variable ("").

Exception

Twig\Error\ RuntimeError

  1.                                         <img data-v-afd21daa="" src="{% if users.stayCoverPic is defined and users.stayCoverPic is not empty %}{{api_entrypoint}}uploads/header_profile/{{users.id}}/cropped/3000_1500/{{users.stayCoverPic.imageName}}{% else %} /images/StayLancer_Default/staylance-6b-20150417_203458.jpg {% endif %}" class="img-responsive minheight staylance-probg" >
  2.                                     {% else %}
  3.                                         <img data-v-6b24df5f="" src="{% if users.headerImage is defined and users.headerImage is not empty %}{{api_entrypoint}}uploads/media/header_profile/{{users.id}}/cropped/3000_1500/{{users.headerImage}}{% else %}/images/StayLancer_Default/staylance-6b-20150417_203458.jpg{% endif %}" class="img-responsive">
  4.                                     {% endif %}
  5.                                     <div data-v-afd21daa="" class="pull-user">
  6.                                         {% if users.livingStatus == 3 %}<div data-v-93fe32ce="" class="pull-user"><img data-v-93fe32ce="" src="/images/family.png" class="positionuser"></div>{% endif %}
  7.                                         {% if users.livingStatus == 1 %}<div data-v-93fe32ce="" class="pull-user"><img data-v-93fe32ce="" src="/images/Single.svg" class="positionuser"></div>{% endif %}
  8.                                         {% if users.livingStatus == 2 %}<div data-v-93fe32ce="" class="pull-user"><img data-v-93fe32ce="" src="/images/couple.png" class="positionuser"></div>{% endif %}
  9.                                         {% if users.livingStatus == 4 %}<div data-v-93fe32ce="" class="pull-user"><img data-v-93fe32ce="" src="/images/home.png" class="positionuser"></div>{% endif %}
  10.                                     </div>
  11.                                     <div data-v-afd21daa="" class="white-profile-box"><img data-v-afd21daa="" src="{% if users.profileImage is defined and users.profileImage is not empty %}{{api_entrypoint}}uploads/profile_pic/{{users.profileImage}}{% else %} /images/staylancer_placerholder_rd.png {% endif %}" class="img-responsive rounded-pic cus-height"></div>
  1.         }
  2.         // line 45
  3.         echo "                                    <div data-v-afd21daa=\"\" class=\"pull-user\">
  4.                                         ";
  5.         // line 46
  6.         if ((twig_get_attribute($this->env$this->source, (isset($context["users"]) || array_key_exists("users"$context) ? $context["users"] : (function () { throw new RuntimeError('Variable "users" does not exist.'46$this->source); })()), "livingStatus", [], "any"falsefalsefalse46) == 3)) {
  7.             echo "<div data-v-93fe32ce=\"\" class=\"pull-user\"><img data-v-93fe32ce=\"\" src=\"/images/family.png\" class=\"positionuser\"></div>";
  8.         }
  9.         // line 47
  10.         echo "                                        ";
  11.         if ((twig_get_attribute($this->env$this->source, (isset($context["users"]) || array_key_exists("users"$context) ? $context["users"] : (function () { throw new RuntimeError('Variable "users" does not exist.'47$this->source); })()), "livingStatus", [], "any"falsefalsefalse47) == 1)) {
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.         </div>
  2.     </div>
  3. </div>
  4. ";
  5.         // line 107
  6.         $this->displayBlock('body'$context$blocks);
  7.         // line 109
  8.         $this->displayBlock('footer'$context$blocks);
  9.         // line 190
  10.         $this->displayBlock('stylesheets'$context$blocks);
  11.         // line 192
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_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  3.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""profile/profile.html.twig"));
  4.         $this->parent $this->loadTemplate("base.html.twig""profile/profile.html.twig"1);
  5.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  6.         
  7.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_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 cannot 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/ProfileController.php (line 179)
  1.         $smoking false;
  2.         if(!empty($user['smoking']) || !empty($user['drinking']) || !empty($user['healthyLifestyle']) || !empty($user['workingOut']) || !empty($user['mindfulness']) || !empty($user['partying'])|| !empty($user['isDrivingLicence']) || !empty($user['isFoodAllergy']) || !empty($user['foodAllergyDetail'])|| !empty($user['isMedicalRequirement']) || !empty($user['isDietaryRequirement'])|| !empty($user['foods']) || !empty($user['musics'])|| !empty($user['iEat']) || !empty($user['hobbies'])|| !empty($user['iEmbrace']) )
  3.         {
  4.             $smoking true;
  5.         }
  6.         return $this->render('profile/profile.html.twig',
  7.                 ["users" => $user'membership' => $membership'userRequests' => $userRequests'profileId' => $id'user' => $users"smoking" => $smoking,]);
  8.     }
  9.     /**
  10.      * @Route("/userhostprofile/{id}", name="userHostProfile")
in vendor/symfony/http-kernel/HttpKernel.php -> userStayProfile (line 163)
  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.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  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.     }
Kernel->handle() in public/index.php (line 29)
  1.     Request::setTrustedHosts([$trustedHosts]);
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

RuntimeError
Twig\Error\RuntimeError:
Impossible to access an attribute ("livingStatus") on a boolean variable ("").

  at templates/profile/profile.html.twig:46
  at twig_get_attribute()
     (var/cache/prod/twig/47/475deea31d01c9dbae050ab603ae1246.php:232)
  at __TwigTemplate_15d21c8a60f1715696c4894853a6ed20->block_body()
     (vendor/twig/twig/src/Template.php:171)
  at Twig\Template->displayBlock()
     (var/cache/prod/twig/24/240b7411087d02b330f7a0b5edde0cef.php:286)
  at __TwigTemplate_ac768c3f0ea28ec7ffde63ba4bd5d54d->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/47/475deea31d01c9dbae050ab603ae1246.php:47)
  at __TwigTemplate_15d21c8a60f1715696c4894853a6ed20->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:280)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:258)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->renderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:266)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/ProfileController.php:179)
  at App\Controller\ProfileController->userStayProfile()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:29)