0

I'm using D8.

I added a field to the user profile:

Lidmaatschapsnummer field_lidmaatschapsnummer

On my Windows Aquia desktop this is running good. I now ftp'ed all to my hosting and get the error on url:

/admin/people

Er is onverwacht een fout opgetreden. Probeer het later nog eens.Twig_Error_Syntax: A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{" in "{# inline_template_start #}<br> {{ {{ field_lidmaatschapsnummer }}" at line 1. in Twig_ExpressionParser->parseHashExpression() (line 302 of vendor/twig/twig/lib/Twig/ExpressionParser.php). Twig_ExpressionParser->parsePrimaryExpression() (Line: 102) Twig_ExpressionParser->getPrimary() (Line: 55) Twig_ExpressionParser->parseExpression() (Line: 149) Twig_Parser->subparse(NULL, ) (Line: 105)

I do not understand how to solve this. The dev is on windows, the hosting on Unix. PHP versions are the same on both.

Any suggestion?

Below is the complete trace:

Er is onverwacht een fout opgetreden. Probeer het later nog eens.Twig_Error_Syntax: A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "punctuation" of value "{" in "{# inline_template_start #}<br> {{ {{ field_lidmaatschapsnummer }}" at line 1. in Twig_ExpressionParser->parseHashExpression() (line 302 of vendor/twig/twig/lib/Twig/ExpressionParser.php). Twig_ExpressionParser->parsePrimaryExpression() (Line: 102) Twig_ExpressionParser->getPrimary() (Line: 55) Twig_ExpressionParser->parseExpression() (Line: 149) Twig_Parser->subparse(NULL, ) (Line: 105) Twig_Parser->parse(Object) (Line: 716) Twig_Environment->parse(Object) (Line: 774) Twig_Environment->compileSource(Object) (Line: 452) Twig_Environment->loadTemplate('{# inline_template_start #} {{ {{ field_lidmaatschapsnummer }}', NULL) (Line: 143) Drupal\Core\Template\TwigEnvironment->renderInline('{# inline_template_start #} {{ {{ field_lidmaatschapsnummer }}', Array) (Line: 52) Drupal\Core\Render\Element\InlineTemplate::preRenderInlineTemplate(Array) call_user_func(Array, Array) (Line: 378) Drupal\Core\Render\Renderer->doRender(Array, 1) (Line: 195) Drupal\Core\Render\Renderer->render(Array, 1) (Line: 151) Drupal\Core\Render\Renderer->Drupal\Core\Render{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 152) Drupal\Core\Render\Renderer->renderPlain(Array) (Line: 411) Drupal\views\Plugin\views\PluginBase->viewsTokenReplace(' {{ {{ field_lidmaatschapsnummer }}', Array) (Line: 1347) Drupal\views\Plugin\views\field\FieldPluginBase->renderAltered(Array, Array) (Line: 1240) Drupal\views\Plugin\views\field\FieldPluginBase->renderText(Array) (Line: 1168) Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object) (Line: 226) template_preprocess_views_view_field(Array, 'views_view_field', Array) (Line: 287) Drupal\Core\Theme\ThemeManager->render('views_view_field', Array) (Line: 437) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195) Drupal\Core\Render\Renderer->render(Array) (Line: 1738) Drupal\views\Plugin\views\field\FieldPluginBase->theme(Object) (Line: 761) Drupal\views\Plugin\views\style\StylePluginBase->elementPreRenderRow(Array) call_user_func(Array, Array) (Line: 378) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195) Drupal\Core\Render\Renderer->render(Array) (Line: 709) Drupal\views\Plugin\views\style\StylePluginBase->renderFields(Array) (Line: 576) Drupal\views\Plugin\views\style\StylePluginBase->renderGrouping(Array, Array, 1) (Line: 468) Drupal\views\Plugin\views\style\StylePluginBase->render(Array) (Line: 2112) Drupal\views\Plugin\views\display\DisplayPluginBase->render() (Line: 1533) Drupal\views\ViewExecutable->render() (Line: 183) Drupal\views\Plugin\views\display\Page->execute() (Line: 1630) Drupal\views\ViewExecutable->executeDisplay('page_1', Array) (Line: 77) Drupal\views\Element\View::preRenderViewElement(Array) call_user_func(Array, Array) (Line: 378) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195) Drupal\Core\Render\Renderer->render(Array, ) (Line: 226) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227) Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 666) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

closed as too broad by leymannx, mradcliffe, Shawn Conn, sanzante, Felix Eve Oct 5 '18 at 9:26

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

I think you have an issue(s) in your twig syntax. The error says

unexpected token "punctuation" of value "{" in "{# inline_template_start #}
{{ {{ field_lidmaatschapsnummer }}" at line 1.

You may have provided opening parenthesis twice. So, removing one set of opening paranthesis will solve your issue. {{ field_lidmaatschapsnummer }}

May this will help you.

  • Thxs had indeed a {{ quate too much. Still strange why this is not an issue on my windows machine... anyhow problem solved... – Justme Oct 1 '18 at 12:36
  • maybe it has gone into Drupal cache on your local. – Ashish Deynap Oct 1 '18 at 12:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.