diff -u b/core/modules/node/lib/Drupal/node/NodeTitleItemList.php b/core/modules/node/lib/Drupal/node/NodeTitleItemList.php --- b/core/modules/node/lib/Drupal/node/NodeTitleItemList.php +++ b/core/modules/node/lib/Drupal/node/NodeTitleItemList.php @@ -7,6 +7,7 @@ namespace Drupal\node; +use Drupal\Core\Field\FieldDefinition; use Drupal\Core\Field\FieldItemList; /** @@ -18,11 +19,14 @@ /** * {@inheritdoc} + * + * The typehint for $definition is a class rather than an interface, because + * there is no interface for setFieldLabel(). */ - public function __construct(array $definition, $name, NodeInterface $node) { + public function __construct(FieldDefinition $definition, $name, NodeInterface $node) { $node_type = node_type_load($node->getType()); if (isset($node_type->title_label)) { - $definition['label'] = $node_type->title_label; + $definition->setFieldLabel($node_type->title_label); } parent::__construct($definition, $name, $node); }