The website encountered an unexpected error

Created on 29 July 2023, over 1 year ago
Updated 18 August 2023, over 1 year ago

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)
๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ธ๐Ÿ‡ฐSlovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @coaston
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TolstoyDotCom L.A.

    I think the thing to do is to use apply spaceless instead of spaceless and endapply instead of endspaceless.

    Patch on request.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dineshkumarbollu

    provided patch for the issue spaceless is deprecated in Twig 3.*.

  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡ธ๐Ÿ‡ฐSlovakia coaston

    Reported issue fixed.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TolstoyDotCom L.A.

    The 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.

  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TolstoyDotCom L.A.
  • Assigned to Jay Jangid
  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Jay Jangid

    Hi, 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:-

    The website encountered an unexpected error. Please try again later.
    
    Drupal\Core\Config\PreExistingConfigException: Configuration objects (block.block.footer) provided by potent_allure already exist in active configuration in Drupal\Core\Config\PreExistingConfigException::create() (line 65 of core\lib\Drupal\Core\Config\PreExistingConfigException.php).
    Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('theme', 'potent_allure') (Line: 132)
    Drupal\Core\ProxyClass\Config\ConfigInstaller->checkConfigurationToInstall('theme', 'potent_allure') (Line: 216)
    Drupal\Core\Extension\ThemeInstaller->install(Array) (Line: 225)
    Drupal\system\Controller\ThemeController->setDefaultTheme(Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    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: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    & 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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    keshav.k โ†’ made their first commit to this issueโ€™s fork.

  • @keshavk opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia keshavv India

    Patch #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.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia ayush.pandey

    Tested with the changes in MR !1, and it fixes the spaceless issue.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia djsagar

    Tested MR 1 it's fixed,

    User error: Twig\Error\SyntaxError: Unknown "spaceless" tag. in /app/web/themes/potent_allure/templates/form/select.html.twig:13 Stack trace: #0 /app/vendor/twig/twig/src/Parser.php(83): Twig\Parser->subparse(NULL, false) #1 /app/vendor/twig/twig/src/Environment.php(491): Twig\Parser->parse(Object(Twig\TokenStream)) #2 /app/vendor/twig/twig/src/Environment.php(519): Twig\Environment->parse(Object(Twig\TokenStream)) #3 /app/web/core/lib/Drupal/Core/Template/TwigEnvironment.php(131): Twig\Environment->compileSource(Object(Twig\Source)) #4 /app/vendor/twig/twig/src/Environment.php(351): Drupal\Core\Template\TwigEnvironment->compileSource(Object(Twig\Source)) #5 /app/vendor/twig/twig/src/Environment.php(312): Twig\Environment->loadTemplate('__TwigTemplate_...', 'themes/potent_a...') #6 /app/web/core/themes/engines/twig/twig.engine(53): Twig\Environment->load('themes/potent_a...') #7 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(372): twig_render_template('themes/potent_a...', Array) #8 /app/web/core/lib/Drupal/Core/Render/Renderer.php(436): Drupal\Core\Theme\ThemeManager->render('select', Array) #9 /app/web/core/lib/Drupal/Core/Render/Renderer.php(449): Drupal\Core\Render\Renderer->doRender(Array) #10 /app/web/core/lib/Drupal/Core/Render/Renderer.php(449): Drupal\Core\Render\Renderer->doRender(Array) #11 /app/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, false) #12 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(474): Drupal\Core\Render\Renderer->render(Array) #13 /app/vendor/twig/twig/src/Environment.php(361) : eval()'d code(77): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true) #14 /app/vendor/twig/twig/src/Template.php(394): __TwigTemplate_64a29fbe319dd9445ff04bb091ab0d4b->doDisplay(Array, Array) #15 /app/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array) #16 /app/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array) #17 /app/vendor/twig/twig/src/TemplateWrapper.php(40): Twig\Template->render(Array, Array) #18 /app/web/core/themes/engines/twig/twig.engine(53): Twig\TemplateWrapper->render(Array) #19 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(372): twig_render_template('themes/potent_a...', Array) #20 /app/web/core/lib/Drupal/Core/Render/Renderer.php(436): Drupal\Core\Theme\ThemeManager->render('field_multiple_...', Array) #21 /app/web/core/lib/Drupal/Core/Render/Renderer.php(449): Drupal\Core\Render\Renderer->doRender(Array) #22 /app/web/core/lib/Drupal/Core/Render/Renderer.php(449): Drupal\Core\Render\Renderer->doRender(Array) #23 /app/web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender(Array, true) #24 /app/web/core/lib/Drupal/Core/Render/Renderer.php(160): Drupal\Core\Render\Renderer->render(Array, true) #25 /app/web/core/lib/Drupal/Core/Render/Renderer.php(583): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() #26 /app/web/core/lib/Drupal/Core/Render/Renderer.php(161): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #27 /app/web/core/lib/Drupal/Core/Render/Renderer.php(175): Drupal\Core\Render\Renderer->renderPlain(Array) #28 /app/web/core/modules/big_pipe/src/Render/BigPipe.php(693): Drupal\Core\Render\Renderer->renderPlaceholder('callback=commen...', Array) #29 /app/web/core/modules/big_pipe/src/Render/BigPipe.php(547): Drupal\big_pipe\Render\BigPipe->renderPlaceholder('callback=commen...', Array) #30 /app/web/core/modules/big_pipe/src/Render/BigPipe.php(305): Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object(Drupal\Core\Asset\AttachedAssets)) #31 /app/web/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent(Object(Drupal\big_pipe\Render\BigPipeResponse)) #32 /app/vendor/symfony/http-foundation/Response.php(423): Drupal\big_pipe\Render\BigPipeResponse->sendContent() #33 /app/web/index.php(20): Symfony\Component\HttpFoundation\Response->send() #34 {main} in Drupal\big_pipe\Render\BigPipe->sendPlaceholders() (line 554 of /app/web/core/modules/big_pipe/src/Render/BigPipe.php)
    #0 /app/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(256, 'Twig\\Error\\Synt...', '/app/web/core/m...', 554)
    #1 [internal function]: _drupal_error_handler(256, 'Twig\\Error\\Synt...', '/app/web/core/m...', 554)
    #2 /app/web/core/modules/big_pipe/src/Render/BigPipe.php(554): trigger_error('Twig\\Error\\Synt...', 256)
    #3 /app/web/core/modules/big_pipe/src/Render/BigPipe.php(305): Drupal\big_pipe\Render\BigPipe->sendPlaceholders(Array, Array, Object(Drupal\Core\Asset\AttachedAssets))
    #4 /app/web/core/modules/big_pipe/src/Render/BigPipeResponse.php(112): Drupal\big_pipe\Render\BigPipe->sendContent(Object(Drupal\big_pipe\Render\BigPipeResponse))
    #5 /app/vendor/symfony/http-foundation/Response.php(423): Drupal\big_pipe\Render\BigPipeResponse->sendContent()
    #6 /app/web/index.php(20): Symfony\Component\HttpFoundation\Response->send()
    #7 {main}

    It's resolved above issue.

    RTBC +1

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States TolstoyDotCom L.A.
  • First commit to issue fork.
  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia VijaySharma_89

    Thank you For Contribution.

  • Status changed to Fixed over 1 year ago
Production build 0.71.5 2024