TypeError: strlen(): Argument #1 ($string) must be of type string, Drupal\Core\Link

Created on 31 October 2024, about 2 months ago

Problem/Motivation

When trying to save certain pages, I get a WSOD with the error:
TypeError: strlen(): Argument #1 ($string) must be of type string, Drupal\Core\Link given in strlen() (line 395 of /code/web/core/lib/Drupal/Component/Utility/Unicode.php).

Backtrace lists the following:
#0 /code/web/core/lib/Drupal/Component/Utility/Unicode.php(395): strlen(Object(Drupal\Core\Link))
#1 /code/web/core/lib/Drupal/Component/Utility/Xss.php(65): Drupal\Component\Utility\Unicode::validateUtf8(Object(Drupal\Core\Link))
#2 /code/web/core/lib/Drupal/Component/Utility/Xss.php(123): Drupal\Component\Utility\Xss::filter(Object(Drupal\Core\Link), Array)
#3 /code/web/core/lib/Drupal/Core/Render/Element/HtmlTag.php(106): Drupal\Component\Utility\Xss::filterAdmin(Object(Drupal\Core\Link))
#4 [internal function]: Drupal\Core\Render\Element\HtmlTag::preRenderHtmlTag(Array)
#5 /code/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array(Array, Array)
#6 /code/web/core/lib/Drupal/Core/Render/Renderer.php(870): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#7 /code/web/core/lib/Drupal/Core/Render/Renderer.php(432): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#8 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#9 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#10 /tmp/rolling/91b6c29/twig/6723b47565f23_field.html.twig_h4wK6avKGwKpTUTyY_fgV9zh_/b-BEA0XC8-l6mGGindABsSn9YxkVqfCIh-cLAeZ6hos.php(93): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#11 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_ae2b52c5eb0a362e8cd2c3d5856890be->doDisplay(Array, Array)
#12 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#13 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#14 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#15 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#16 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/cla...', Array)
#17 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('field', Array)
#18 /code/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender(Array)
#19 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#20 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#21 /tmp/rolling/91b6c29/twig/6723b47565f23_taxonomy-term.html.twig_Be0ocywRHA3-HXKuguOVv2Q8P/sc429CWp_mw9M1Q0tYZbwXHPpUsW7C6jBWfN3sVAQ_g.php(72): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#22 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_51318c976b44f21412816184e3788edf->doDisplay(Array, Array)
#23 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#24 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#25 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#26 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#27 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/cla...', Array)
#28 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('taxonomy_term', Array)
#29 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#30 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#31 /tmp/rolling/91b6c29/twig/6723b47565f23_field.html.twig_h4wK6avKGwKpTUTyY_fgV9zh_/b-BEA0XC8-l6mGGindABsSn9YxkVqfCIh-cLAeZ6hos.php(93): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#32 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_ae2b52c5eb0a362e8cd2c3d5856890be->doDisplay(Array, Array)
#33 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#34 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#35 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#36 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#37 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/cla...', Array)
#38 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('field', Array)
#39 /code/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender(Array)
#40 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#41 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#42 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(84): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#43 /code/vendor/twig/twig/src/Template.php(437): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->block_content(Array, Array)
#44 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(68): Twig\Template->yieldBlock('content', Array, Array)
#45 /code/vendor/twig/twig/src/Template.php(437): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->block_paragraph(Array, Array)
#46 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(51): Twig\Template->yieldBlock('paragraph', Array, Array)
#47 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->doDisplay(Array, Array)
#48 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#49 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#50 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#51 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#52 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('modules/contrib...', Array)
#53 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('paragraph', Array)
#54 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#55 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#56 /tmp/rolling/91b6c29/twig/6723b47565f23_field.html.twig_h4wK6avKGwKpTUTyY_fgV9zh_/b-BEA0XC8-l6mGGindABsSn9YxkVqfCIh-cLAeZ6hos.php(73): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#57 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_ae2b52c5eb0a362e8cd2c3d5856890be->doDisplay(Array, Array)
#58 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#59 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#60 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#61 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#62 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/cla...', Array)
#63 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('field', Array)
#64 /code/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender(Array)
#65 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#66 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#67 /tmp/rolling/91b6c29/twig/6723b47565f23_eck-entity.html.twig_B41lHRsW_zXD5_xGbWQhZJTYf/sHLrdfp0E9i3RSRDk1cSdAIf-T03vZ4ltRZY9O_bczg.php(53): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#68 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_acfc54df2fa7ddb6e2f693ff29de5338->doDisplay(Array, Array)
#69 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#70 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#71 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#72 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#73 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('modules/contrib...', Array)
#74 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('eck_entity', Array)
#75 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#76 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#77 /tmp/rolling/91b6c29/twig/6723b47565f23_field.html.twig_h4wK6avKGwKpTUTyY_fgV9zh_/b-BEA0XC8-l6mGGindABsSn9YxkVqfCIh-cLAeZ6hos.php(93): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#78 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_ae2b52c5eb0a362e8cd2c3d5856890be->doDisplay(Array, Array)
#79 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#80 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#81 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#82 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#83 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('core/themes/cla...', Array)
#84 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('field', Array)
#85 /code/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\Core\Render\Renderer->doRender(Array)
#86 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, false)
#87 /code/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\Core\Render\Renderer->render(Array)
#88 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(84): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#89 /code/vendor/twig/twig/src/Template.php(437): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->block_content(Array, Array)
#90 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(68): Twig\Template->yieldBlock('content', Array, Array)
#91 /code/vendor/twig/twig/src/Template.php(437): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->block_paragraph(Array, Array)
#92 /tmp/rolling/91b6c29/twig/6723b47565f23_paragraph.html.twig_2pGtdU5hKpA7bRpzUFsovpzcj/0rW-AyWROcD4vfHN8CXhLhmq8OgaShXZpmv82ZG3EyY.php(51): Twig\Template->yieldBlock('paragraph', Array, Array)
#93 /code/vendor/twig/twig/src/Template.php(393): __TwigTemplate_9b46a769a9c9fc58a82243f8e9005300->doDisplay(Array, Array)
#94 /code/vendor/twig/twig/src/Template.php(349): Twig\Template->yield(Array, Array)
#95 /code/vendor/twig/twig/src/Template.php(364): Twig\Template->display(Array)
#96 /code/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\Template->render(Array)
#97 /code/web/core/themes/engines/twig/twig.engine(33): Twig\TemplateWrapper->render(Array)
#98 /code/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('modules/contrib...', Array)
#99 /code/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\Core\Theme\ThemeManager->render('paragraph', Array)
#100 /code/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\Core\Render\Renderer->doRender(Array, true)
#101 /code/web/core/lib/Drupal/Core/Render/Renderer.php(165): Drupal\Core\Render\Renderer->render(Array, true)
#102 /code/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#103 /code/web/core/lib/Drupal/Core/Render/Renderer.php(164): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#104 /code/web/core/lib/Drupal/Core/Render/Renderer.php(174): Drupal\Core\Render\Renderer->renderInIsolation(Array)
#105 /code/web/modules/contrib/token/token.tokens.inc(1801): Drupal\Core\Render\Renderer->renderPlain(Array)
#106 /code/web/modules/contrib/token/token.tokens.inc(503): _field_tokens('entity', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#107 [internal function]: token_tokens('entity', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#108 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(416): call_user_func_array(Object(Closure), Array)
#109 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'token')
#110 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(415): Drupal\Core\Extension\ModuleHandler->invokeAllWith('tokens', Object(Closure))
#111 /code/web/core/lib/Drupal/Core/Utility/Token.php(364): Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array)
#112 /code/web/modules/contrib/token/token.tokens.inc(1097): Drupal\Core\Utility\Token->generate('entity', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#113 [internal function]: token_tokens('node', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#114 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(416): call_user_func_array(Object(Closure), Array)
#115 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'token')
#116 /code/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(415): Drupal\Core\Extension\ModuleHandler->invokeAllWith('tokens', Object(Closure))
#117 /code/web/core/lib/Drupal/Core/Utility/Token.php(364): Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array)
#118 /code/web/core/lib/Drupal/Core/Utility/Token.php(241): Drupal\Core\Utility\Token->generate('node', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#119 /code/web/core/lib/Drupal/Core/Utility/Token.php(191): Drupal\Core\Utility\Token->doReplace(true, '[node:field_bod...', Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#120 /code/web/modules/contrib/metatag/src/MetatagToken.php(66): Drupal\Core\Utility\Token->replace('[node:field_bod...', Array, Array, NULL)
#121 /code/web/modules/contrib/metatag/src/MetatagManager.php(784): Drupal\metatag\MetatagToken->replace('[node:field_bod...', Array, Array)
#122 /code/web/modules/contrib/metatag/src/MetatagManager.php(629): Drupal\metatag\MetatagManager->processTagValue(Object(Drupal\metatag_open_graph\Plugin\metatag\Tag\OgDescription), Array, Array, false, 'en')
#123 /code/web/modules/contrib/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php(61): Drupal\metatag\MetatagManager->generateRawElements(Array, Object(Drupal\node\Entity\Node))
#124 /code/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList::Drupal\metatag\Plugin\Field\{closure}()
#125 /code/web/modules/contrib/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php(48): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#126 /code/web/modules/contrib/metatag/src/TypedData/ComputedItemListTrait.php(32): Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList->computeValue()
#127 /code/web/core/lib/Drupal/Core/TypedData/ComputedItemListTrait.php(114): Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList->ensureComputedValue()
#128 /code/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(162): Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList->isEmpty()
#129 /code/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(164): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object(Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList))
#130 /code/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php(106): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object(Drupal\Core\Entity\Plugin\DataType\EntityAdapter), Array, true)
#131 /code/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php(93): Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object(Drupal\Core\Entity\Plugin\DataType\EntityAdapter), NULL, NULL)
#132 /code/web/core/lib/Drupal/Core/TypedData/TypedData.php(132): Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object(Drupal\Core\Entity\Plugin\DataType\EntityAdapter))
#133 /code/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php(518): Drupal\Core\TypedData\TypedData->validate()
#134 /code/web/core/lib/Drupal/Core/Entity/ContentEntityForm.php(188): Drupal\Core\Entity\ContentEntityBase->validate()
#135 [internal function]: Drupal\Core\Entity\ContentEntityForm->validateForm(Array, Object(Drupal\Core\Form\FormState))
#136 /code/web/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array(Array, Array)
#137 /code/web/core/lib/Drupal/Core/Form/FormValidator.php(274): Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object(Drupal\Core\Form\FormState))
#138 /code/web/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm(Array, Object(Drupal\Core\Form\FormState), 'node_page_edit_...')
#139 /code/web/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormValidator->validateForm('node_page_edit_...', Array, Object(Drupal\Core\Form\FormState))
#140 /code/web/core/lib/Drupal/Core/Form/FormBuilder.php(326): Drupal\Core\Form\FormBuilder->processForm('node_page_edit_...', Array, Object(Drupal\Core\Form\FormState))
#141 /code/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\node\NodeForm), Object(Drupal\Core\Form\FormState))
#142 /code/web/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#143 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch))
#144 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#145 /code/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#146 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#147 /code/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#148 /code/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#149 /code/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#150 /code/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#151 /code/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#152 /code/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#153 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#154 /code/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#155 /code/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#156 /code/web/core/modules/ban/src/BanMiddleware.php(50): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#157 /code/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#158 /code/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#159 /code/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#160 /code/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#161 /code/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#162 /code/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#163 {main}

Tried searching around, but other issues seemed to be from Bootstrap, or to a preprocess for a table

Not sure if related, but I have the following in the Console Development before I save the page:
"\nAn AJAX HTTP error occurred.\nHTTP Result Code: 500\nDebugging information follows.\nPath: /node/3916/edit?ajax_form=1\nStatusText: error\nResponseText: The website encountered an unexpected error. Try again later.", name: "AjaxError", stack: "@https://dev-springfield-d9.pantheonsite.io/core/misc/ajax.js?v=10.3.6:19...\n@https://dev-springfield-d9.pantheonsite.io/core/misc/ajax.js?v=10.3.6:19...\n" }
โ€‹
message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 500\nDebugging information follows.\nPath: /node/3916/edit?ajax_form=1\nStatusText: error\nResponseText: The website encountered an unexpected error. Try again later."
โ€‹
name: "AjaxError"
โ€‹
stack: "@https://dev-springfield-d9.pantheonsite.io/core/misc/ajax.js?v=10.3.6:19...\n@https://dev-springfield-d9.pantheonsite.io/core/misc/ajax.js?v=10.3.6:19...\n"

๐Ÿ› Bug report
Status

Active

Version

10.5 โœจ

Component

link.module

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States bdh676 Springfield, MA

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

Comments & Activities

  • Issue created by @bdh676
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bdh676 Springfield, MA
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bdh676 Springfield, MA
  • Let's investigate. Please update the issue summary with the steps to set up a site that exhibits the bug and how to set up these certain pages.

    It actually looks like a link object is passing through a filter function. We'll need to know why.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia mdsohaib4242

    To debug this issue

    • Look at the page youโ€™re trying to save (node 3916). See if any fields contain links, as they might be causing the issue.
    • See if any links are being added incorrectly. Links should be rendered properly, not passed like as objects.
    • There might be code that outputs a Link object (using \Drupal\Core\Link) without rendering it properly (using ->toString() or ->getUrl()->toString()).
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bdh676 Springfield, MA

    Seems like this was an issue with the Metatag module and the Core Link. When I get some time I am going to try to recreate it on a fresh site and look into it more.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States gaelicmichael

    I got this error (as reported in the error logs) when I was attempting to migrate a Drupal 7 site to Drupal 10.3.10.

    The error log looks like this:

    TypeError: strlen(): Argument #1 ($string) must be of type string, Drupal\Core\Link given in strlen() (line 395 of /var/www/html/hchs10/core/lib/Drupal/Component/Utility/Unicode.php)
    #0 /var/www/html/hchs10/core/lib/Drupal/Component/Utility/Unicode.php(395): strlen()
    #1 /var/www/html/hchs10/core/lib/Drupal/Component/Utility/Xss.php(65): Drupal\Component\Utility\Unicode::validateUtf8()
    #2 /var/www/html/hchs10/core/lib/Drupal/Component/Utility/Xss.php(123): Drupal\Component\Utility\Xss::filter()
    #3 /var/www/html/hchs10/core/lib/Drupal/Core/Ajax/MessageCommand.php(127): Drupal\Component\Utility\Xss::filterAdmin()
    #4 /var/www/html/hchs10/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\MessageCommand->render()
    #5 /var/www/html/hchs10/core/modules/big_pipe/src/Render/BigPipe.php(567): Drupal\Core\Ajax\AjaxResponse->addCommand()
    #6 /var/www/html/hchs10/core/modules/big_pipe/src/Render/BigPipe.php(283): Drupal\big_pipe\Render\BigPipe->sendPlaceholders()
    #7 /var/www/html/hchs10/core/modules/big_pipe/src/Render/BigPipeResponse.php(113): Drupal\big_pipe\Render\BigPipe->sendContent()
    #8 /var/www/html/hchs10/vendor/symfony/http-foundation/Response.php(423): Drupal\big_pipe\Render\BigPipeResponse->sendContent()
    #9 /var/www/html/hchs10/index.php(20): Symfony\Component\HttpFoundation\Response->send()
    #10 {main}

  • @gaelicmichael Metatag seems uninvolved on the site where you see this one. What exactly is Drupal doing when this occurs?

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States gaelicmichael

    Only the top part of the error stack is repeated in my error log, so this may be an unrelated issue. I am trying to migrate a site from D7, as I said, and this is triggered during the process.

    I'll try to find a better way to report the error.

Production build 0.71.5 2024