Problem/Motivation
1.Install theme
2.Set as default
3.Try to visit any page ie.front page >
The website encountered an unexpected error. Please try again later.
Twig\Error\SyntaxError: Unexpected "spaceless" tag (expecting closing tag for the "for" tag defined near line 27). in Twig\Parser->subparse() (line 30 of themes\contrib\potent_allure\templates\menu\toolbar.html.twig).
Twig\TokenParser\ForTokenParser->parse(Object) (Line: 170)
Twig\Parser->subparse(NULL, ) (Line: 83)
Twig\Parser->parse(Object) (Line: 491)
Twig\Environment->parse(Object) (Line: 519)
Twig\Environment->compileSource(Object) (Line: 131)
Drupal\Core\Template\TwigEnvironment->compileSource(Object) (Line: 351)
Twig\Environment->loadTemplate('__TwigTemplate_17ae6661a7d971fc53c17959f10e1515', 'themes/contrib/potent_allure/templates/menu/toolbar.html.twig') (Line: 312)
Twig\Environment->load('themes/contrib/potent_allure/templates/menu/toolbar.html.twig') (Line: 53)
twig_render_template('themes/contrib/potent_allure/templates/menu/toolbar.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('toolbar', Array) (Line: 436)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 449)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 80)
__TwigTemplate_8e12d8bc2711289f6c61f7bf9c0ccf59->doDisplay(Array, Array) (Line: 394)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 367)
Twig\Template->display(Array) (Line: 379)
Twig\Template->render(Array, Array) (Line: 40)
Twig\TemplateWrapper->render(Array) (Line: 53)
twig_render_template('themes/contrib/potent_allure/templates/layout/html.html.twig', Array) (Line: 372)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 436)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 158)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 159)
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(Object, 'kernel.view') (Line: 171)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comments
Comment #2
tolstoydotcomI think the thing to do is to use
apply spacelessinstead ofspacelessandendapplyinstead ofendspaceless.Patch on request.
Comment #3
dineshkumarbollu commentedprovided patch for the issue
spacelessis deprecated in Twig 3.*.Comment #4
dineshkumarbollu commentedComment #5
coaston commentedReported issue fixed.
Comment #6
tolstoydotcomThe patch in #3 applies but it doesn't include all the cases. I added an additional patch that should be used in addition to the other patch.
Comment #7
tolstoydotcomComment #8
jay jangid commentedComment #9
jay jangid commentedHi, I have tested this issue in Drupal 9.5.x and Drupal 10.1.x.
When i install this theme in Drupal 9.5.x it showing this error:-
& when I installed theme in Drupal 10.1.x. it's successfully installed.
Please guide as if I am missing any steps to reproduce this issue.
I am sharing a screenshot for your reference.
Thank you.
Comment #12
keshavv commentedPatch #6 Worked well. But the issue is still there, There were four occurrences of the issue.
I have applied #6 patch and fixed the remaining as well. Created an MR !1.
Please review and merge.
Thank you.
Comment #13
ayush.pandey commentedTested with the changes in MR !1, and it fixes the spaceless issue.
Comment #14
djsagar commentedTested MR 1 it's fixed,
It's resolved above issue.
RTBC +1
Comment #15
tolstoydotcomComment #17
vijaysharma_89 commentedThank you For Contribution.
Comment #18
vijaysharma_89 commented