按照此Local Development Guide的方式安装Drupal 8之后
我成功完成了“安装Drupal”部分的步骤。当我在浏览器中打开它时,我只会看到
The website encountered an unexpected error. Please try again later.
在$config['system.logging']['error_level'] = 'verbose';
中设置settings.php
后,我设法获得以下错误跟踪
The website encountered an unexpected error. Please try again later.
Twig\Error\SyntaxError: An exception has been thrown during the compilation of a template ("Node "options" does not exist for Node "Drupal\Core\Template\TwigNodeTrans".") in "core/themes/bartik/templates/block--system-menu-block.html.twig". in Twig\Environment->compileSource() (line 798 of /var/www/html/vendor/twig/twig/src/Environment.php).
Drupal\Core\Template\TwigNodeTrans->compile(Object) (Line: 118)
Twig\Node\Node->compile(Object) (Line: 103)
Twig\Compiler->subcompile(Object) (Line: 38)
Twig\Node\BlockNode->compile(Object) (Line: 118)
Twig\Node\Node->compile(Object) (Line: 118)
Twig\Node\Node->compile(Object) (Line: 103)
Twig\Compiler->subcompile(Object) (Line: 107)
Twig\Node\ModuleNode->compileTemplate(Object) (Line: 77)
Twig\Node\ModuleNode->compile(Object) (Line: 92)
Twig\Compiler->compile(Object) (Line: 772)
Twig\Environment->compile(Object) (Line: 793)
Twig\Environment->compileSource(Object) (Line: 482)
Twig\Environment->loadClass('__TwigTemplate_8a36b536e32bf0b1914811d79e1edf0e487059aa5ccf779f9b95f53355e28ac3', 'core/themes/bartik/templates/block--system-menu-block.html.twig', NULL) (Line: 445)
Twig\Environment->loadTemplate('core/themes/bartik/templates/block--system-menu-block.html.twig') (Line: 64)
twig_render_template('core/themes/bartik/templates/block--system-menu-block.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 64)
__TwigTemplate_b957555d616a9ab14351dcabd437c24eff5410fef69055c9c4fd4e0c505e8ee5->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('core/themes/bartik/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 102)
__TwigTemplate_a886be0944b0f166f485440f11e78d43e4d22671d48ee10699c8dcf8db39b676->doDisplay(Array, Array) (Line: 443)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 414)
Twig\Template->display(Array) (Line: 422)
Twig\Template->render(Array) (Line: 64)
twig_render_template('core/themes/classy/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 437)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
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: 184)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 121)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 75)
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: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
考虑到安装过程中的错误,除了ddev
以外,我从头开始重新安装了Drupal
和Docker
。但我仍然在那里。我的操作系统是Arch(Manjaro),而Docker容器来自ddev
答案 0 :(得分:1)
这是Twig错误,用户已开始使用Drupal 8.6.15和Twig 1.40.ish报告此问题。
中的说明降级您的树枝版本更新:从v1.40.0 => v1.40.1设置了解决问题的版本(https://github.com/twigphp/Twig/commit/732c489693fab432bcaf9ccbb1c53b91fe135700