TypeError: Drupal\Core\Field\WidgetBase::__construct(): Argument #5 ($third_party_settings) must be of type array, null given

Created on 26 June 2025, 18 days ago

Problem/Motivation

Installing the latest release on a fresh install of Drupal 11.2 results in a fatal error:

 [error]  TypeError: Drupal\Core\Field\WidgetBase::__construct(): Argument #5 ($third_party_settings) must be of type array, null given, called in /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 64 in Drupal\Core\Field\WidgetBase->__construct() (line 53 of /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php) #0 /var/www/html/web/core/lib/Drupal/Core/Field/WidgetBase.php(64): Drupal\Core\Field\WidgetBase->__construct()
#1 /var/www/html/web/core/lib/Drupal/Core/Field/WidgetPluginManager.php(123): Drupal\Core\Field\WidgetBase::create()
#2 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(81): Drupal\Core\Field\WidgetPluginManager->createInstance()
#3 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(80): Drupal\Core\Plugin\DefaultLazyPluginCollection->initializePlugin()
#4 /var/www/html/web/core/lib/Drupal/Component/Plugin/LazyPluginCollection.php(152): Drupal\Component\Plugin\LazyPluginCollection->get()
#5 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php(114): Drupal\Component\Plugin\LazyPluginCollection->getIterator()
#6 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(303): Drupal\Core\Plugin\DefaultLazyPluginCollection->getConfiguration()
#7 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityDisplayBase.php(272): Drupal\Core\Config\Entity\ConfigEntityBase->preSave()
#8 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(529): Drupal\Core\Entity\EntityDisplayBase->preSave()
#9 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(484): Drupal\Core\Entity\EntityStorageBase->doPreSave()
#10 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(239): Drupal\Core\Entity\EntityStorageBase->save()
#11 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(370): Drupal\Core\Config\Entity\ConfigEntityStorage->save()
#12 /var/www/html/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(618): Drupal\Core\Entity\EntityBase->save()
#13 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(429): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#14 /var/www/html/web/core/lib/Drupal/Core/Config/ConfigInstaller.php(175): Drupal\Core\Config\ConfigInstaller->createConfiguration()
#15 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php(75): Drupal\Core\Config\ConfigInstaller->installDefaultConfig()
#16 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(448): Drupal\Core\ProxyClass\Config\ConfigInstaller->installDefaultConfig()
#17 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleInstaller.php(229): Drupal\Core\Extension\ModuleInstaller->doInstall()
#18 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install()
#19 /var/www/html/vendor/drush/drush/src/Commands/pm/PmCommands.php(101): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install()
#20 [internal function]: Drush\Commands\pm\PmCommands->install()
#21 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#22 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#23 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#24 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(387): Consolidation\AnnotatedCommand\CommandProcessor->process()
#25 /var/www/html/vendor/symfony/console/Command/Command.php(318): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#26 /var/www/html/vendor/symfony/console/Application.php(1092): Symfony\Component\Console\Command\Command->run()
#27 /var/www/html/vendor/symfony/console/Application.php(341): Symfony\Component\Console\Application->doRunCommand()
#28 /var/www/html/vendor/symfony/console/Application.php(192): Symfony\Component\Console\Application->doRun()
#29 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run()
#30 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
#31 /var/www/html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
#32 /var/www/html/vendor/bin/drush.php(119): include('...')
#33 {main}. 

Proposed resolution

Explicitly declare third_party_settings in the field_program widget definition in the config page form definition, which is causing this problem.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada mandclu

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

Comments & Activities

Production build 0.71.5 2024