Setup
- Solr version: 8.6
- Drupal Core version: 10.3.9
- Search API version: 1.37.0
- Search API Solr version: 4.3.7
- Configured Solr Connector:
Issue
I see the following errors in logs infrequently (eg 2 times in the past two days) where mb_strtolower() in SearchApiSolrHighlightedFormatterSettingsTrait.php:111 is called with an array instead of a string, resulting in a TypeError.
mb_strtolower(): Argument #1 ($string) must be of type string, array given
Full stack trace:
#0 /app/web/modules/contrib/search_api_solr/src/Plugin/Field/FieldFormatter/SearchApiSolrHighlightedFormatterSettingsTrait.php(111): mb_strtolower(Array)
#1 /app/web/modules/contrib/search_api_solr/src/Plugin/Field/FieldFormatter/SearchApiSolrHighlightedTextDefaultFormatter.php(47): Drupal\\search_api_solr\\Plugin\\Field\\FieldFormatter\\SearchApiSolrHighlightedTextDefaultFormatter->getHighlightedValue(Object(Drupal\\text\\Plugin\\Field\\FieldType\\TextWithSummaryItem), '<p>Access free ...', 'en', Object(Drupal\\Core\\Cache\\CacheableMetadata))
#2 /app/web/core/lib/Drupal/Core/Field/FormatterBase.php(91): Drupal\\search_api_solr\\Plugin\\Field\\FieldFormatter\\SearchApiSolrHighlightedTextDefaultFormatter->viewElements(Object(Drupal\\text\\Plugin\\Field\\FieldType\\TextFieldItemList), 'en')
#3 /app/web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(268): Drupal\\Core\\Field\\FormatterBase->view(Object(Drupal\\text\\Plugin\\Field\\FieldType\\TextFieldItemList), 'en')
#4 /app/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(282): Drupal\\Core\\Entity\\Entity\\EntityViewDisplay->buildMultiple(Array)
#5 /app/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(340): Drupal\\layout_builder\\Entity\\LayoutBuilderEntityViewDisplay->buildMultiple(Array)
#6 /app/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(282): Drupal\\Core\\Entity\\EntityViewBuilder->buildComponents(Array, Array, Array, 'full')
#7 /app/web/core/modules/block_content/src/BlockContentViewBuilder.php(36): Drupal\\Core\\Entity\\EntityViewBuilder->buildMultiple(Array)
#8 /app/web/core/modules/block_content/src/BlockContentViewBuilder.php(24): Drupal\\block_content\\BlockContentViewBuilder->viewMultiple(Array, 'full', NULL)
#9 /app/web/core/modules/block_content/src/Plugin/Block/BlockContentBlock.php(189): Drupal\\block_content\\BlockContentViewBuilder->view(Object(Drupal\\block_content\\Entity\\BlockContent), 'full')
#10 /app/web/core/modules/block/src/BlockViewBuilder.php(171): Drupal\\block_content\\Plugin\\Block\\BlockContentBlock->build()
#11 [internal function]: Drupal\\block\\BlockViewBuilder::preRender(Array)
#12 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(113): call_user_func_array('Drupal\\\\block\\\\Bl...', Array)
#13 /app/web/core/lib/Drupal/Core/Render/Renderer.php(870): Drupal\\Core\\Render\\Renderer->doTrustedCallback('Drupal\\\\block\\\\Bl...', Array, 'Render #pre_ren...', 'exception', 'Drupal\\\\Core\\\\Ren...')
#14 /app/web/core/lib/Drupal/Core/Render/Renderer.php(432): Drupal\\Core\\Render\\Renderer->doCallback('#pre_render', 'Drupal\\\\block\\\\Bl...', Array)
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(504): Drupal\\Core\\Render\\Renderer->doRender(Array)
#16 /app/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\\Core\\Render\\Renderer->doRender(Array, false)
#17 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\\Core\\Render\\Renderer->render(Array)
#18 /mnt/private/twig/67ae8cf67c123_page.html.twig_-oE-E-_u1bqCVjd0J6Sl74yMG/dZVmJ_v00sNeotrLwaLr1Kqr9b4vFppD_Fex_nl13a4.php(125): Drupal\\Core\\Template\\TwigExtension->escapeFilter(Object(Drupal\\Core\\Template\\TwigEnvironment), Array, 'html', NULL, true)
#19 /app/vendor/twig/twig/src/Template.php(393): __TwigTemplate_20a597245f3bea3a6f49bacd3509ca75->doDisplay(Array, Array)
#20 /app/vendor/twig/twig/src/Template.php(349): Twig\\Template->yield(Array, Array)
#21 /app/vendor/twig/twig/src/Template.php(364): Twig\\Template->display(Array)
#22 /app/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\\Template->render(Array)
#23 /app/web/core/themes/engines/twig/twig.engine(33): Twig\\TemplateWrapper->render(Array)
#24 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/custom/s...', Array)
#25 /app/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\\Core\\Theme\\ThemeManager->render('page', Array)
#26 /app/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\\Core\\Render\\Renderer->doRender(Array, false)
#27 /app/web/core/lib/Drupal/Core/Template/TwigExtension.php(476): Drupal\\Core\\Render\\Renderer->render(Array)
#28 /mnt/private/twig/67ae8cf67c123_html.html.twig_cixgzGPfp323jti4b646bUT7p/qNpTFdg5hDvJ1EtNZ0kwyAGEHh0KliWvVX7t4nYlU4U.php(85): Drupal\\Core\\Template\\TwigExtension->escapeFilter(Object(Drupal\\Core\\Template\\TwigEnvironment), Array, 'html', NULL, true)
#29 /app/vendor/twig/twig/src/Template.php(393): __TwigTemplate_e451655472ce87e673676c2525c1efa7->doDisplay(Array, Array)
#30 /app/vendor/twig/twig/src/Template.php(349): Twig\\Template->yield(Array, Array)
#31 /app/vendor/twig/twig/src/Template.php(364): Twig\\Template->display(Array)
#32 /app/vendor/twig/twig/src/TemplateWrapper.php(35): Twig\\Template->render(Array)
#33 /app/web/core/themes/engines/twig/twig.engine(33): Twig\\TemplateWrapper->render(Array)
#34 /app/web/core/lib/Drupal/Core/Theme/ThemeManager.php(348): twig_render_template('themes/contrib/...', Array)
#35 /app/web/core/lib/Drupal/Core/Render/Renderer.php(491): Drupal\\Core\\Theme\\ThemeManager->render('html', Array)
#36 /app/web/core/lib/Drupal/Core/Render/Renderer.php(248): Drupal\\Core\\Render\\Renderer->doRender(Array, false)
#37 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(158): Drupal\\Core\\Render\\Renderer->render(Array)
#38 /app/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\\Core\\Render\\MainContent\\HtmlRenderer->Drupal\\Core\\Render\\MainContent\\{closure}()
#39 /app/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(159): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))
#40 /app/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))
#41 [internal function]: Drupal\\Core\\EventSubscriber\\MainContentViewSubscriber->onViewRenderArray(Object(Symfony\\Component\\HttpKernel\\Event\\ViewEvent), 'kernel.view', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#42 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\\Component\\HttpKernel\\Event\\ViewEvent), 'kernel.view', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))
#43 /app/vendor/symfony/http-kernel/HttpKernel.php(186): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ViewEvent), 'kernel.view')
#44 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
#45 /app/web/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#46 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#47 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#48 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#49 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(191): Drupal\\Core\\StackMiddleware\\ContentLength->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#50 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(128): Drupal\\page_cache\\StackMiddleware\\PageCache->fetch(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#51 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(82): Drupal\\page_cache\\StackMiddleware\\PageCache->lookup(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#52 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#53 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#54 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#55 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#56 /app/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)
#57 /app/web/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))
#58 {main}