localgovdrupal / localgov_subsites

Replaces LocalGov Campaigns with a new name and extended functionality to support subsites within LocalGov Drupal installations.
GNU General Public License v2.0
4 stars 2 forks source link

Enabling banners results in WSOD #14

Closed andybroomfield closed 2 years ago

andybroomfield commented 3 years ago

Installed localgov_subsites (after hard deletion and purge of campaigns on a test site, so no campaigns are present). Enabled the banner block.

Got the following error.

Recoverable fatal error: Object of class Drupal\paragraphs\Entity\Paragraph could not be converted to string in Drupal\Component\Utility\UrlHelper::parse() (line 170 of core/lib/Drupal/Component/Utility/UrlHelper.php).

I belive its related to modules/contrib/localgov_subsites/templates/subsite-overview-banner.html.twig

Full Error stack track:

Recoverable fatal error: Object of class Drupal\paragraphs\Entity\Paragraph could not be converted to string in Drupal\Component\Utility\UrlHelper::parse() (line 170 of core/lib/Drupal/Component/Utility/UrlHelper.php).
Drupal\Component\Utility\UrlHelper::parse(Object) (Line: 234)
file_create_url(Object) (Line: 147)
Drupal\Core\Template\TwigExtension->Drupal\Core\Template\{closure}(Object) (Line: 58)
__TwigTemplate_5f0396bc623e9aad5e688ffd9b281ba7bbf2731ea86a77885912ec8ee238976c->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('modules/contrib/localgov_subsites/templates/subsite-overview-banner.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('subsite_overview_banner', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 95)
__TwigTemplate_312ee329b0af5442a89acf9ad82336fcbc772405dfa09e6646585f36e13b89ca->block_content(Array, Array) (Line: 216)
Twig\Template->displayBlock('content', Array, Array) (Line: 84)
__TwigTemplate_312ee329b0af5442a89acf9ad82336fcbc772405dfa09e6646585f36e13b89ca->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('core/themes/classy/templates/block/block.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('block', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 444)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 198)
__TwigTemplate_1b6817f72c9bc97be44ccb2ca95834b7ca595f45354f273c342d753973c11cdf->block_content(Array, Array) (Line: 216)
Twig\Template->displayBlock('content', Array, Array) (Line: 107)
__TwigTemplate_1b6817f72c9bc97be44ccb2ca95834b7ca595f45354f273c342d753973c11cdf->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array, Array) (Line: 59)
__TwigTemplate_566b76278f0e5e06ce04293758f6e12ee92fb8619ad91dc709b4dc0ad9ec583d->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/localgov_theme_bhcc/templates/system/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 501)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 142)
__TwigTemplate_927d3dbbb39741f57d62395168e78d6d6e246833876ea271fbdebcdc223db716->doDisplay(Array, Array) (Line: 455)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 422)
Twig\Template->display(Array) (Line: 434)
Twig\Template->render(Array) (Line: 64)
twig_render_template('themes/contrib/localgov_theme/templates/system/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 431)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 200)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 573)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
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: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
andybroomfield commented 3 years ago

The following won't work if its now a media entity / paragraph.

<div class="hero blend-darken hero--tint" style="background-image: url('{{ file_url(image) }}')">
graham-web commented 3 years ago

Just bumped into this today. The "Subsite overview banner" block is currently unusable without custom theming to work around the problem.

The "Subsite banner" block works on overview pages too, though... so perhaps the overview block isn't even needed?

andybroomfield commented 2 years ago

Going to bump this as ran into it again, although it was the block being in a disbaled region. Can I propose that we simply remove the template subsite-overview-banner.html.twig and the overview block itself, as it is not actully used (the page block is) so this is just not needed and it has never worked with subsites so cost should be minimal.