- 🇮🇳India lolmanKD
Hi All,
This issue is also related to this Error Unsupported operand types
Error: Unsupported operand types in Drupal\Core\Utility\LinkGenerator->generate() (line 161 of /core/lib/Drupal/Core/Utility/LinkGenerator.php)We faced this issue on multiple pages like /sitemap and etc post D8.9.x(latest) to D9.3.x migration
I have added a patch for Drupal 9.3.x
- 🇮🇳India chaitanyadessai Goa
Patch applied successfully from #7 , fixed issue for Drupal 9.3.x.
Getting WSOD with Unsupported operand types in LinkFormatter->buildUrl() error in D10.1 after updating to PHP 8.1.27.
Successfully installed the patch in #22, but still getting an error.PHP Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, string given in /var/www/.../web/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php:247 Stack trace: #0 /var/www/.../web/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php(247): array_merge() #1 /var/www/.../web/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php(178): Drupal\link\Plugin\Field\FieldFormatter\LinkFormatter->buildUrl() #2 /var/www/.../web/core/lib/Drupal/Core/Field/FormatterBase.php(89): Drupal\link\Plugin\Field\FieldFormatter\LinkFormatter->viewElements() #3 /var/www/.../web/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php(265): Drupal\Core\Field\FormatterBase->view() #4 /var/www/.../web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php(268): Drupal\Core\Entity\Entity\EntityViewDisplay->buildMultiple() #5 /var/www/.../web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(339): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() #6 /var/www/.../web/core/modules/node/src/NodeViewBuilder.php(24): Drupal\Core\Entity\EntityViewBuilder->buildComponents() #7 /var/www/.../web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(281): Drupal\node\NodeViewBuilder->buildComponents() #8 /var/www/.../web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php(238): Drupal\Core\Entity\EntityViewBuilder->buildMultiple() #9 [internal function]: Drupal\Core\Entity\EntityViewBuilder->build() #10 /var/www/.../web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array() #11 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(788): Drupal\Core\Render\Renderer->doTrustedCallback() #12 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(377): Drupal\Core\Render\Renderer->doCallback() #13 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(204): Drupal\Core\Render\Renderer->doRender() #14 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(160): Drupal\Core\Render\Renderer->render() #15 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(583): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}() #16 /var/www/.../web/core/lib/Drupal/Core/Render/Renderer.php(161): Drupal\Core\Render\Renderer->executeInRenderContext() #17 /var/www/.../web/core/modules/node/src/Plugin/Search/NodeSearch.php(525): Drupal\Core\Render\Renderer->renderPlain() #18 /var/www/.../web/core/modules/node/src/Plugin/Search/NodeSearch.php(489): Drupal\node\Plugin\Search\NodeSearch->indexNode() #19 /var/www/.../web/core/modules/search/search.module(80): Drupal\node\Plugin\Search\NodeSearch->updateIndex() #20 /var/www/.../web/core/lib/Drupal/Core/Cron.php(335): search_cron() #21 /var/www/.../web/core/lib/Drupal/Core/Extension/ModuleHandler.php(388): Drupal\Core\Cron->Drupal\Core\{closure}() #22 /var/www/.../web/core/lib/Drupal/Core/Cron.php(343): Drupal\Core\Extension\ModuleHandler->invokeAllWith() #23 /var/www/.../web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers() #24 /var/www/.../web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run() #25 /var/www/.../web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run() #26 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate() #27 /var/www/.../web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func() #28 /var/www/.../vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() #29 /var/www/.../web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(63): Symfony\Component\HttpKernel\HttpKernel->terminate() #30 /var/www/.../web/core/lib/Drupal/Core/DrupalKernel.php(688): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate() #31 /var/www/.../vendor/drush/drush/src/Boot/DrupalBoot8.php(331): Drupal\Core\DrupalKernel->terminate() #32 [internal function]: Drush\Boot\DrupalBoot8->terminate() #33 {main} thrown in /var/www/.../web/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php on line 247
Curiously this error seems to have resolved itself. The error above was reported during a cache rebuild, but is now gone after the cache rebuild and http restart.