From 4571fda48750084f5a2eef0a01cbf259d7dd66dd Mon Sep 17 00:00:00 2001
From: Lauri Eskola <lauri.eskola@acquia.com>
Date: Sun, 23 Jul 2023 10:11:05 +0300
Subject: [PATCH] Issue #3370179 by fago, Wim Leers, borisson_, smustgrave:
 Clarify why FieldConfigBase::getDataType() is 'list' and not
 'field_config_base'

---
 core/lib/Drupal/Core/Field/FieldConfigBase.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core/lib/Drupal/Core/Field/FieldConfigBase.php b/core/lib/Drupal/Core/Field/FieldConfigBase.php
index fc18ccc40a0b..b58f49dc6986 100644
--- a/core/lib/Drupal/Core/Field/FieldConfigBase.php
+++ b/core/lib/Drupal/Core/Field/FieldConfigBase.php
@@ -490,6 +490,12 @@ public static function createFromDataType($type) {
    * {@inheritdoc}
    */
   public function getDataType() {
+    // This object serves as data definition for field item lists, thus
+    // the correct data type is 'list'. This is not to be confused with
+    // the config schema type, 'field_config_base', which is used to
+    // describe the schema of the configuration backing this objects.
+    // @see \Drupal\Core\Field\FieldItemList
+    // @see \Drupal\Core\TypedData\DataDefinitionInterface
     return 'list';
   }
 
-- 
GitLab