Symfony Exception

RuntimeError

HTTP 500 Internal Server Error

Impossible to access an attribute ("name") on a null variable.

Exception

Twig\Error\ RuntimeError

  1.                                                         <div class="form-check mb-4">
  2.                                                             <input type="checkbox" class="custom-control-input" id="filter-local-only" name="localonly" value="1">
  3.                                                             <label class="custom-control-label" for="filter-local-only">{{ "Local events only"|trans }}</label>
  4.                                                         </div>
  5.                                                     </div>
  6.                                                     <p id="user-country" class="text-muted">{{ "Events in %countryname%"|trans({"%countryname%" : userLocation['country'].name}) }} <span class="flag flag-{{userLocation['country'].code|lower}} ml-2"></span></p>
  7.                                                     {% endif %}
  8.                                                 <div id="filter-country-container" class="mt-4">
  9.                                                     <label for="country">{{ "Country"|trans }}</label>
  10.                                                     <select id="country" class="select2" name="country" data-sort-options="1">
  11.                                                         <option value="">&nbsp;</option>
  1.                 echo "</label>
  2.                                                         </div>
  3.                                                     </div>
  4.                                                     <p id=\"user-country\" class=\"text-muted\">";
  5.                 // line 147
  6.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Events in %countryname%", ["%countryname%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["userLocation"]) || array_key_exists("userLocation"$context) ? $context["userLocation"] : (function () { throw new RuntimeError('Variable "userLocation" does not exist.'147$this->source); })()), "country", [], "array"falsefalsefalse147), "name", [], "any"falsefalsefalse147)]), "html"nulltrue);
  7.                 echo " <span class=\"flag flag-";
  8.                 echo twig_escape_filter($this->envtwig_lower_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["userLocation"]) || array_key_exists("userLocation"$context) ? $context["userLocation"] : (function () { throw new RuntimeError('Variable "userLocation" does not exist.'147$this->source); })()), "country", [], "array"falsefalsefalse147), "code", [], "any"falsefalsefalse147)), "html"nulltrue);
  9.                 echo " ml-2\"></span></p>
  10.                                                     ";
  11.             }
in vendor/twig/twig/src/Template.php->block_content (line 184)
  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 83
  3.         echo "
  4.     ";
  5.         // line 84
  6.         $this->displayBlock('content'$context$blocks);
  7.         // line 85
  8.         echo "
  9.     ";
  10.         // line 86
  11.         $this->loadTemplate("Global/footer.html.twig""Global/layout.html.twig"86)->display($context);
in vendor/twig/twig/src/Template.php->doDisplay (line 407)
  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 380)
  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.             // line 6
  2.             $context["pagetitle"] = $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Events");
  3.         }
  4.         // line 1
  5.         $this->parent $this->loadTemplate("Global/layout.html.twig""Front/Event/events.html.twig"1);
  6.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  7.         
  8.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  9.     }
in vendor/twig/twig/src/Template.php->doDisplay (line 407)
  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 380)
  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 392)
  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.      *
  2.      * @throws Error if something went wrong like a thrown exception while rendering the template
  3.      */
  4.     public function render($name, array $parameters = [])
  5.     {
  6.         return $this->load($name)->render($parameters);
  7.     }
  8.     /**
  9.      * {@inheritdoc}
  10.      *
  1.     protected function render(string $view, array $parameters = [], Response $response null): Response
  2.     {
  3.         if ($this->container->has('templating')) {
  4.             @trigger_error('Using the "templating" service is deprecated since version 4.3 and will be removed in 5.0; use Twig instead.'E_USER_DEPRECATED);
  5.             $content $this->container->get('templating')->render($view$parameters);
  6.         } elseif ($this->container->has('twig')) {
  7.             $content $this->container->get('twig')->render($view$parameters);
  8.         } else {
  9.             throw new \LogicException('You can not use the "render" method if the Templating Component or the Twig Bundle are not available. Try running "composer require symfony/twig-bundle".');
  10.         }
AbstractController->render('Front/Event/events.html.twig', array('events' => object(SlidingPagination), 'category' => 'all')) in src/Controller/Front/EventController.php (line 44)
  1.         $events $paginator->paginate($services->getEvents(array("category" => $categorySlug'keyword' => $keyword'localonly' => $localonly'country' => $country'location' => $location'startdate' => $startdate'pricemin' => $pricemin'pricemax' => $pricemax'audience' => $audience'organizer' => $organizer'freeonly' => $freeonly'onlineonly' => $onlineonly))->getQuery(), $request->query->getInt('page'1), $services->getSetting("events_per_page"), array('wrap-queries' => true));
  2.         return $this->render('Front/Event/events.html.twig', [
  3.                     'events' => $events,
  4.                     'category' => $category,
  5.         ]);
  6.     }
  7.     /**
  8.      * @Route("/event/{slug}", name="event")
  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 $request$type HttpKernelInterface::MASTER_REQUEST$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.     }
Kernel->handle(object(Request)) in public/index.php (line 25)
  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 ("name") on a null variable.

  at templates/Front/Event/events.html.twig:147
  at twig_get_attribute(object(Environment), object(Source), null, 'name', array(), 'any', false, false, false, 147)
     (var/cache/prod/twig/5c/5c770fecc29b2cfbeca6b43119b3faffa45b8d046a6d2365c08233f916597bf9.php:407)
  at __TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d->block_content(array('events' => object(SlidingPagination), 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events', 'navigation' => array(array('current' => 'Events')), 'eventsoncalendar' => array(array('title' => 'Bright Tulip', 'start' => '2024-04-19 19:00', 'end' => '2024-04-19 21:00', 'url' => '/en/event/bright-tulip-1'), array('title' => 'Pink Galoshes', 'start' => '2024-04-25 18:00', 'end' => '2024-04-25 20:00', 'url' => '/en/event/pink-galoshes'), array('title' => 'Daisy Buzz', 'start' => '2024-05-09 19:00', 'end' => '2024-05-09 21:00', 'url' => '/en/event/daisy-buzz'), array('title' => 'Swingin\' Spring Gnome', 'start' => '2024-05-24 18:00', 'end' => '2024-05-24 20:00', 'url' => '/en/event/swingin-spring-gnome'), array('title' => 'Lilac Sunset', 'start' => '2024-05-30 19:00', 'end' => '2024-05-30 21:00', 'url' => '/en/event/lilac-sunset')), 'eventsonmap' => array(), 'category' => 'all', 'userLocation' => array('record' => object(City), 'country' => null)), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'meta_dynamic_seo' => array(object(__TwigTemplate_f41a6d611268ccd448a1ed541ad620143c058c99d695113c5ff16345a3a8a15a), 'block_meta_dynamic_seo'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (vendor/twig/twig/src/Template.php:184)
  at Twig\Template->displayBlock('content', array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'meta_dynamic_seo' => array(object(__TwigTemplate_f41a6d611268ccd448a1ed541ad620143c058c99d695113c5ff16345a3a8a15a), 'block_meta_dynamic_seo'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (var/cache/prod/twig/16/1637cd045091c321876910b42a3eb2397a1d7ec8672003e91c14173774f3be00.php:234)
  at __TwigTemplate_f41a6d611268ccd448a1ed541ad620143c058c99d695113c5ff16345a3a8a15a->doDisplay(array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'meta_dynamic_seo' => array(object(__TwigTemplate_f41a6d611268ccd448a1ed541ad620143c058c99d695113c5ff16345a3a8a15a), 'block_meta_dynamic_seo'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (vendor/twig/twig/src/Template.php:407)
  at Twig\Template->displayWithErrorHandling(array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'meta_dynamic_seo' => array(object(__TwigTemplate_f41a6d611268ccd448a1ed541ad620143c058c99d695113c5ff16345a3a8a15a), 'block_meta_dynamic_seo'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (vendor/twig/twig/src/Template.php:380)
  at Twig\Template->display(array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (var/cache/prod/twig/5c/5c770fecc29b2cfbeca6b43119b3faffa45b8d046a6d2365c08233f916597bf9.php:57)
  at __TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d->doDisplay(array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton', 'pagetitle' => 'Events'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (vendor/twig/twig/src/Template.php:407)
  at Twig\Template->displayWithErrorHandling(array('events' => object(SlidingPagination), 'category' => 'all', 'app' => object(AppVariable), 'services' => object(AppServices), 'locales' => 'en|fr|', 'google_maps_api_key' => '', 'date_format' => 'eee dd MMM y, h:mm a z', 'date_format_date_only' => 'D j M Y', 'date_timezone' => 'America/Edmonton'), array('title' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_title'), 'stylesheets' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_stylesheets'), 'content' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_content'), 'javascripts' => array(object(__TwigTemplate_e72dfabdbb1a0f7270c23cd447764cfccc803eb50cec32774752c9b667dbe59d), 'block_javascripts')))
     (vendor/twig/twig/src/Template.php:380)
  at Twig\Template->display(array('events' => object(SlidingPagination), 'category' => 'all'))
     (vendor/twig/twig/src/Template.php:392)
  at Twig\Template->render(array('events' => object(SlidingPagination), 'category' => 'all'))
     (vendor/symfony/twig-bridge/TwigEngine.php:54)
  at Symfony\Bridge\Twig\TwigEngine->render('Front/Event/events.html.twig', array('events' => object(SlidingPagination), 'category' => 'all'))
     (vendor/symfony/framework-bundle/Controller/ControllerTrait.php:233)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render('Front/Event/events.html.twig', array('events' => object(SlidingPagination), 'category' => 'all'))
     (src/Controller/Front/EventController.php:44)
  at App\Controller\Front\EventController->events(object(Request), object(Paginator), object(AppServices), object(Translator))
     (vendor/symfony/http-kernel/HttpKernel.php:158)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/http-kernel/HttpKernel.php:80)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/http-kernel/Kernel.php:201)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public/index.php:25)