Error 500 Internal Server Error

GET https://xpanel.n46.net/en/contact

Forwarded to ErrorController (afe57f)

Exceptions

Unknown "is_mobile" function in web/contact.html.twig at line 35.

Exception

Twig\Error\ SyntaxError

Show exception properties
Twig\Error\SyntaxError {#2369
  -lineno: 35
  -rawMessage: "Unknown "is_mobile" function."
  -source: Twig\Source {#1245
    -code: """
      {% extends 'base.html.twig' %}\n
      \n
      {% block title %}{{ 'title.page_contact_us'|trans }} | {{ domain_name }}{% endblock %}\n
      {% block description %}{{ 'description.page_contact_us'|trans({'%domain_name%': domain_name}) }}{% endblock %}\n
      \n
      {% block stylesheets %}\n
          <script src="https://www.google.com/recaptcha/enterprise.js?render={{ google_recaptcha_site_key }}"></script>\n
          <script>\n
              function executeRecaptchaAndSubmit() {\n
                  grecaptcha.enterprise.execute('{{ google_recaptcha_site_key }}', {action: 'submit'}).then(function(token) {\n
                      const form = document.getElementById("contact-form");\n
                      const input = document.createElement("input");\n
                      input.type = "hidden";\n
                      input.name = "g-recaptcha-response";\n
                      input.value = token;\n
                      form.appendChild(input);\n
                      form.submit();\n
                  });\n
              }\n
          </script>\n
          {{ parent() }}\n
              <link rel="stylesheet" href="/frontend/v1/styles/layout_styles_screen.css" type="text/css" media="screen">\n
              <link rel="stylesheet" href="/frontend/v1/styles/contact_styles.css" type="text/css" media="screen">\n
              <link rel="stylesheet" href="/frontend/v1/styles/layout_styles_print.css" type="text/css" media="print">\n
      {% endblock %}\n
      \n
      {% block body_id 'contact_us' %}\n
      \n
      {% block body %}\n
                  <main>\n
                      <div class="bckImage global-banner__background"></div>\n
                      <div id="main" class="v5-main">\n
                          <!-- ======= BEGIN - WRAP ======= -->\n
                          <div class="wrap">\n
      {% if is_mobile() %}{% if not is_tablet() %}\n
          <header class="global-banner">\n
              <h1 class="global-banner__title">Get in touch</h1>\n
              <h4 class="global-banner__description">Fill in the contact form on this page and we will get back to you as soon as practical</h4>\n
          </header>\n
      {% endif %}{% endif %}\n
          <div class="global-banner--space"></div>\n
      {{ include('default/_flash_messages.html.twig') }}\n
          <section class="v5__container remove--social">\n
              <div class="v5__row">\n
                  <div class="v5__col v5__col-main v5__col-main--left-padding">\n
                      <div class="mainForm formRedesigned margin-bottom-large form-v5--with-bg sg-redesign form-v5">\n
      {% if not is_tablet() %}{% if not is_mobile() %}\n
                          <h1 class="form-v5__h1 hide-phone">Get in touch</h1>\n
                          <h2 class="form-v5__desc is--small hide-phone margin-bottom-large">Fill in the contact form on this page and we will get back to you as soon as practical</h2>\n
      {% endif %}{% endif %}\n
                          <h3 class="form-v5__h3">{{ 'legend.contact_us'|trans }}</h3>\n
                          {{ form_start(form, {'action': path('contact'), 'method': 'POST', attr: {'class': 'form-v5', 'id': 'contact-form'}}) }}\n
                              {{ form_errors(form) }}\n
                              {{ form_row(form._token) }}\n
                              <div class="v5__row">\n
                                  <div class="v5__col v5__col-half--lg">\n
                                      <div class="v5__row">\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap">\n
                                              {% if form.firstName.vars.errors|length > 0 %}\n
                                                  {{ form_widget(form.firstName, {'attr': {'autofocus': true}}) }}\n
                                                  {{ form_errors(form.firstName) }}\n
                                              {% else %}\n
                                                  {{ form_widget(form.firstName) }}\n
                                              {% endif %}\n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap">\n
                                              {% if form.lastName.vars.errors|length > 0 %}\n
                                                  {{ form_widget(form.lastName, {'attr': {'autofocus': true}}) }}\n
                                                  {{ form_errors(form.lastName) }}\n
                                              {% else %}\n
                                                  {{ form_widget(form.lastName) }}\n
                                              {% endif %}\n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap">\n
                                              {% if form.email.vars.errors|length > 0 %}\n
                                                  {{ form_widget(form.email, {'attr': {'autofocus': true}}) }}\n
                                                  {{ form_errors(form.email) }}\n
                                              {% else %}\n
                                                  {{ form_widget(form.email) }}\n
                                              {% endif %}\n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap">\n
                                              {% if form.phoneNumber.vars.errors|length > 0 %}\n
                                                  <div class="input-group">\n
                                                      <span class="input-group-text">+373</span>\n
                                                      <div class="form-floating flex-grow-1">\n
                                                          {{ form_widget(form.phoneNumber, {'attr': {'autofocus': true, 'placeholder': 'label.phone_number'}}) }}\n
                                                      </div>\n
                                                  </div>\n
                                                  <div>\n
                                                      {{ form_errors(form.phoneNumber) }}\n
                                                  </div>\n
                                              {% else %}\n
                                                  <div class="input-group">\n
                                                      <span class="input-group-text">+373</span>\n
                                                      <div class="form-floating flex-grow-1">\n
                                                          {{ form_widget(form.phoneNumber, {'attr': {'placeholder': 'label.phone_number'}}) }}\n
                                                      </div>\n
                                                  </div>\n
                                              {% endif %}\n
                                              </div>\n
                                          </div>\n
                                      </div>\n
                                  </div>\n
                                  <div class="v5__col v5__col-half--lg">\n
                                      <div class="v5__row">\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap">\n
                                              {% if form.subject.vars.errors|length > 0 %}\n
                                                  {{ form_widget(form.subject, {'attr': {'autofocus': true}}) }}\n
                                                  {{ form_errors(form.subject) }}\n
                                              {% else %}\n
                                                  {{ form_widget(form.subject) }}\n
                                              {% endif %}\n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="form-v5__wrap msForm__field" data-app="jsCounterApp" data-max="600">\n
                                                  <div class="form-v5__flex">\n
                                                      <small class="form-v5__counter hide-phone"><span class="counterNum light_grey">0</span>&nbsp;/&nbsp;600</small>\n
                                                  </div>\n
                                                  {% if form.message.vars.errors|length > 0 %}\n
                                                      {{ form_widget(form.message, {'attr': {'autofocus': true, 'class': 'msForm__field__input'}}) }}\n
                                                      {{ form_errors(form.message) }}\n
                                                  {% else %}\n
                                                      {{ form_widget(form.message, {'attr': {'cols': '30', 'rows': '5', 'class': 'msForm__field__input'}}) }}\n
                                                  {% endif %}\n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div class="auto--height msForm__field">\n
                                                  {{ form_widget(form.accept, {'id': 'fv_acceptTermsCheckboxReq'}) }} \n
                                              </div>\n
                                          </div>\n
                                          <div class="v5__col v5__col-full">\n
                                              <div id="requestFormSubmit">\n
                                                  {{ form_widget(form.submit, {attr: {\n
                                                      'class': 'w-100 w-100--mob mainButton button-submit button-submit-2 text-center',\n
                                                      'onclick': 'event.preventDefault(); executeRecaptchaAndSubmit();'\n
                                                  }}) }}\n
                                              </div>\n
                                          </div>\n
                                      </div>\n
                                  </div>\n
                              </div>\n
                          {{ form_end(form) }}\n
                      </div>\n
                      <ul class="v5__tick-list no--icon tick-list" style="margin-top:40px;margin-bottom: 80px;">\n
                          <li>{{ 'body.clarifications'|trans({'%domain_name%': domain_name, '%create_company_account%': path('create_company_account')})|raw }}</li>\n
                      </ul>\n
                  </div>\n
                  <div class="v5__col v5__col-sidebar global-banner--space-sidebar">\n
                      <div class="center margin-bottom hide-print">\n
                      <!-- ======= BEGIN - Ad manager ======= -->\n
              {% if is_mobile() %}\n
                  {% if is_tablet() %}\n
                      <!-- ======= BEGIN - Ads on tablet ======= -->\n
      \n
                      <!-- ======= END - Ads on tablet ======= -->\n
                  {% else %}\n
                      <!-- ======= BEGIN - Ads on phone ======= -->\n
      \n
                      <!-- ======= END - Ads on phone ======= -->\n
                  {% endif %}\n
              {% else %}\n
                      <!-- ======= BEGIN - Ads on computer ======= -->\n
      \n
                      <!-- ======= END - Ads on computer ======= -->\n
              {% endif %}\n
                      <!-- ======= END - Ad manager ======= -->\n
                      </div>\n
                      <div class="hide-phone">\n
                          <div class="brokerMainText v5-sidebar similarSearches-wrapper has--border" style="margin-top: 0;">\n
                              <h4>Useful links</h4>\n
                              <div class="similarSearches__item">\n
                                  <svg viewBox="0, 0, 20, 20">\n
                                      <use xlink:href="/frontend/v1/images/svg/icons.svg#link-thin"></use>\n
                                  </svg>\n
                                  <a href="{{ path('create_company_account') }}" rel="nofollow">Agent registration</a>\n
                              </div>\n
                              <div class="similarSearches__item">\n
                                  <svg viewBox="0, 0, 20, 20">\n
                                      <use xlink:href="/frontend/v1/images/svg/icons.svg#link-thin"></use>\n
                                  </svg>\n
                                  <a href="{{ path('list_real_estate_agencies') }}">Find agents</a>\n
                              </div>\n
                              <div class="similarSearches__item">\n
                                  <svg viewBox="0, 0, 20, 20">\n
                                      <use xlink:href="/frontend/v1/images/svg/icons.svg#link-thin"></use>\n
                                  </svg>\n
                                  <a href="{{ path('faq') }}">FAQ</a>\n
                              </div>\n
                          </div>\n
                      </div>\n
                  </div>\n
              </div>\n
          </section>\n
                          </div>\n
                          <!-- ======= END - WRAP ======= -->\n
                      </div>\n
                  </main>\n
      {% endblock %}\n
      \n
      {% block javascripts_footer %}\n
              <script src="/frontend/v1/scripts/layout_scripts.js"></script>\n
              <script src="/frontend/v1/scripts/scripts_en.js"></script>\n
              <script src="/frontend/v1/scripts/contact_scripts.js"></script>\n
      {% endblock %}
      """
    -name: "web/contact.html.twig"
    -path: "/var/www/vhosts/1007/domains/n46.net/xpanel/templates/web/contact.html.twig"
  }
  -phpFile: "/var/www/vhosts/1007/domains/n46.net/xpanel/vendor/twig/twig/src/Parser.php"
  -phpLine: 462
}
  1. <main>
  2. <div class="bckImage global-banner__background"></div>
  3. <div id="main" class="v5-main">
  4. <!-- ======= BEGIN - WRAP ======= -->
  5. <div class="wrap">
  6. {% if is_mobile() %}{% if not is_tablet() %}
  7. <header class="global-banner">
  8. <h1 class="global-banner__title">Get in touch</h1>
  9. <h4 class="global-banner__description">Fill in the contact form on this page and we will get back to you as soon as practical</h4>
  10. </header>
  11. {% endif %}{% endif %}
  1. return new MacroReferenceExpression($alias['node']->getNode('var'), $alias['name'], $this->parseCallableArguments($parser, $line, false), $line);
  2. }
  3. $args = $this->parseNamedArguments($parser, false);
  4. $function = $parser->getFunction($name, $line);
  5. if ($function->getParserCallable()) {
  6. $fakeNode = new EmptyNode($line);
  7. $fakeNode->setSourceContext($parser->getStream()->getSourceContext());
in vendor/twig/twig/src/Parser.php -> parse (line 396)
  1. }
  2. $token = $this->getCurrentToken();
  3. while ($token->test(Token::OPERATOR_TYPE) && ($ep = $this->parsers->getByName(InfixExpressionParserInterface::class, $token->getValue())) && $ep->getPrecedence() >= $precedence) {
  4. $this->getStream()->next();
  5. $expr = $ep->parse($this, $expr, $token);
  6. $this->checkPrecedenceDeprecations($ep, $expr);
  7. $token = $this->getCurrentToken();
  8. }
  9. return $expr;
  1. final class IfTokenParser extends AbstractTokenParser
  2. {
  3. public function parse(Token $token): Node
  4. {
  5. $lineno = $token->getLine();
  6. $expr = $this->parser->parseExpression();
  7. $stream = $this->parser->getStream();
  8. $stream->expect(Token::BLOCK_END_TYPE);
  9. $body = $this->parser->subparse([$this, 'decideIfFork']);
  10. $tests = [$expr, $body];
  11. $else = null;
in vendor/twig/twig/src/Parser.php -> parse (line 230)
  1. }
  2. $this->stream->next();
  3. $subparser->setParser($this);
  4. $node = $subparser->parse($token);
  5. if (!$node) {
  6. trigger_deprecation('twig/twig', '3.12', 'Returning "null" from "%s" is deprecated and forbidden by "TokenParserInterface".', $subparser::class);
  7. } else {
  8. $node->setNodeTag($subparser->getTag());
  9. $rv[] = $node;
  1. $this->parser->setBlock($name, $block = new BlockNode($name, new EmptyNode(), $lineno));
  2. $this->parser->pushLocalScope();
  3. $this->parser->pushBlockStack($name);
  4. if ($stream->nextIf(Token::BLOCK_END_TYPE)) {
  5. $body = $this->parser->subparse([$this, 'decideBlockEnd'], true);
  6. if ($token = $stream->nextIf(Token::NAME_TYPE)) {
  7. $value = $token->getValue();
  8. if ($value != $name) {
  9. throw new SyntaxError(\sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext());
in vendor/twig/twig/src/Parser.php -> parse (line 230)
  1. }
  2. $this->stream->next();
  3. $subparser->setParser($this);
  4. $node = $subparser->parse($token);
  5. if (!$node) {
  6. trigger_deprecation('twig/twig', '3.12', 'Returning "null" from "%s" is deprecated and forbidden by "TokenParserInterface".', $subparser::class);
  7. } else {
  8. $node->setNodeTag($subparser->getTag());
  9. $rv[] = $node;
in vendor/twig/twig/src/Parser.php -> subparse (line 110)
  1. $this->importedSymbols = [[]];
  2. $this->embeddedTemplates = [];
  3. $this->expressionRefs = new \WeakMap();
  4. try {
  5. $body = $this->subparse($test, $dropNeedle);
  6. if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) {
  7. $body = new EmptyNode();
  8. }
  9. } catch (SyntaxError $e) {
  1. {
  2. if (null === $this->parser) {
  3. $this->parser = new Parser($this);
  4. }
  5. return $this->parser->parse($stream);
  6. }
  7. /**
  8. * @return void
  9. */
  1. * @throws SyntaxError When there was an error during tokenizing, parsing or compiling
  2. */
  3. public function compileSource(Source $source): string
  4. {
  5. try {
  6. return $this->compile($this->parse($this->tokenize($source)));
  7. } catch (Error $e) {
  8. $e->setSourceContext($source);
  9. throw $e;
  10. } catch (\Exception $e) {
  11. throw new SyntaxError(\sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
in vendor/twig/twig/src/Environment.php -> compileSource (line 408)
  1. $this->cache->load($key);
  2. }
  3. if (!class_exists($cls, false)) {
  4. $source = $this->getLoader()->getSourceContext($name);
  5. $content = $this->compileSource($source);
  6. if (!isset($this->hotCache[$name])) {
  7. $this->cache->write($key, $content);
  8. $this->cache->load($key);
  9. }
in vendor/twig/twig/src/Environment.php -> loadTemplate (line 370)
  1. trigger_deprecation('twig/twig', '3.9', 'Passing a "%s" instance to "%s" is deprecated.', self::class, __METHOD__);
  2. return $name;
  3. }
  4. return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name));
  5. }
  6. /**
  7. * Loads a template internal representation.
  8. *
  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. if (null !== $block) {
  2. return $this->container->get('twig')->load($view)->renderBlock($block, $parameters);
  3. }
  4. return $this->container->get('twig')->render($view, $parameters);
  5. }
  6. private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response
  7. {
  8. $content = $this->doRenderView($view, $block, $parameters, $method);
  1. return $this->container->get('twig')->render($view, $parameters);
  2. }
  3. private function doRender(string $view, ?string $block, array $parameters, ?Response $response, string $method): Response
  4. {
  5. $content = $this->doRenderView($view, $block, $parameters, $method);
  6. $response ??= new Response();
  7. if (200 === $response->getStatusCode()) {
  8. foreach ($parameters as $v) {
  9. if ($v instanceof FormInterface && $v->isSubmitted() && !$v->isValid()) {
  1. * If an invalid form is found in the list of parameters, a 422 status code is returned.
  2. * Forms found in parameters are auto-cast to form views.
  3. */
  4. protected function render(string $view, array $parameters = [], ?Response $response = null): Response
  5. {
  6. return $this->doRender($view, null, $parameters, $response, __FUNCTION__);
  7. }
  8. /**
  9. * Renders a block in a view.
  10. *
AbstractController->render() in src/Controller/ContactController.php (line 67)
  1. $this->addFlash('success', 'flash.success.message_sent');
  2. return $this->redirectToRoute('contact');
  3. }
  4. return $this->render('web/contact.html.twig', [
  5. 'form' => $form,
  6. ]);
  7. }
  8. }
  1. $this->dispatcher->dispatch($event, KernelEvents::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, $controllerMetadata);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type, $controllerMetadata);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. if (!$this->handlingHttpCache) {
  2. $this->resetServices = true;
  3. }
  4. try {
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. } finally {
  7. --$this->requestStackSize;
  8. }
  9. }
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. $response->send(false);
  7. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
  8. fastcgi_finish_request();
in vendor/autoload_runtime.php -> run (line 32)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/var/www/vhosts/1007/domains/n46.net/xpanel/vendor/autoload_runtime.php') in public_html/index.php (line 5)
  1. <?php declare(strict_types=1);
  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

Level Channel Message
INFO 07:27:35 request Matched route "_profiler".
{
    "route": "_profiler",
    "route_parameters": {
        "_route": "_profiler",
        "_controller": "web_profiler.controller.profiler::panelAction",
        "token": "1dd986"
    },
    "request_uri": "https://xpanel.n46.net/_profiler/1dd986?panel=exception&type=request",
    "method": "GET"
}

Stack Trace

SyntaxError
Twig\Error\SyntaxError:
Unknown "is_mobile" function in "web/contact.html.twig" at line 35.

  at templates/web/contact.html.twig:35
  at Twig\Parser->getFunction()
     (vendor/twig/twig/src/ExpressionParser/Infix/FunctionExpressionParser.php:51)
  at Twig\ExpressionParser\Infix\FunctionExpressionParser->parse()
     (vendor/twig/twig/src/Parser.php:396)
  at Twig\Parser->parseExpression()
     (vendor/twig/twig/src/TokenParser/IfTokenParser.php:39)
  at Twig\TokenParser\IfTokenParser->parse()
     (vendor/twig/twig/src/Parser.php:230)
  at Twig\Parser->subparse()
     (vendor/twig/twig/src/TokenParser/BlockTokenParser.php:46)
  at Twig\TokenParser\BlockTokenParser->parse()
     (vendor/twig/twig/src/Parser.php:230)
  at Twig\Parser->subparse()
     (vendor/twig/twig/src/Parser.php:110)
  at Twig\Parser->parse()
     (vendor/twig/twig/src/Environment.php:558)
  at Twig\Environment->parse()
     (vendor/twig/twig/src/Environment.php:589)
  at Twig\Environment->compileSource()
     (vendor/twig/twig/src/Environment.php:408)
  at Twig\Environment->loadTemplate()
     (vendor/twig/twig/src/Environment.php:370)
  at Twig\Environment->load()
     (vendor/twig/twig/src/Environment.php:333)
  at Twig\Environment->render()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:472)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRenderView()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:477)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->doRender()
     (vendor/symfony/framework-bundle/Controller/AbstractController.php:281)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->render()
     (src/Controller/ContactController.php:67)
  at App\Controller\ContactController->index()
     (vendor/symfony/http-kernel/HttpKernel.php:188)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:143)
  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/vhosts/1007/domains/n46.net/xpanel/vendor/autoload_runtime.php')
     (public_html/index.php:5)