Fatal TypeError on all pages after enabling popup block.

Created on 1 October 2024, 3 months ago

I'm running Drupal 11.0.4 with PHP 8.3.12 and simple_popup_blocks 8.x-3.3.

After enabling any popup block, all non-administrative pages begin throwing fatal errors and do not load. In dblog I see the following:

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given in Drupal\Component\Utility\Html::escape() (line 431 of /opt/drupal/web/core/lib/Drupal/Component/Utility/Html.php).

I think this issue may be related to this one. πŸ› Warning: htmlspecialchars() expects parameter 1 to be string, array given RTBC However in my case the priority has escalated to Critical because Drupal 11 and PHP 8.3 are stricter and this is now a fatal error.

I was also able to solve this issue by applying the patch found here. πŸ› Warning: htmlspecialchars() expects parameter 1 to be string, array given RTBC

For reference, the full traceback looks like the following:

#0 [internal function]: Drupal\Component\Utility\Html::escape(NULL)
#1 /opt/drupal/web/modules/contrib/simple_popup_blocks/simple_popup_blocks.module(58): array_map('Drupal\\Componen...', Array)
#2 /opt/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(311): simple_popup_blocks_page_attachments(Array)
#3 /opt/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}(Object(Closure), 'simple_popup_bl...')
#4 /opt/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(308): Drupal\Core\Extension\ModuleHandler->invokeAllWith('page_attachment...', Object(Closure))
#5 /opt/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(285): Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array)
#6 /opt/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#7 /opt/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(284): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#8 /opt/drupal/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(128): Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#9 /opt/drupal/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\CurrentRouteMatch))
#10 /opt/drupal/vendor/symfony/event-dispatcher/EventDispatcher.php(246): Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#11 /opt/drupal/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#12 /opt/drupal/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'kernel.view', Object(Symfony\Component\HttpKernel\Event\ViewEvent))
#13 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(188): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ViewEvent), 'kernel.view')
#14 /opt/drupal/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#15 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /opt/drupal/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\page_cache\StackMiddleware\PageCache->fetch(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /opt/drupal/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\page_cache\StackMiddleware\PageCache->lookup(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /opt/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /opt/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /opt/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#28 {main}
πŸ› Bug report
Status

Active

Version

3.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States alexmarkley

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

Comments & Activities

Production build 0.71.5 2024