Clarify why FieldConfigBase::getDataType() is 'list' and not 'field_config_base'

Created on 26 June 2023, 12 months ago
Updated 23 July 2023, 11 months ago

Problem/Motivation

Surfaced in #3361034, at #3361034-7: Make 'sequence' Typed Data instances return type of 'sequence' instead of 'list' .
\Drupal\Core\Field\FieldConfigBase::getDataType() (introduced in #2283977: Create a new ConfigEntity type for storing bundle-specific customizations of base fields ) looks like this:

  public function getDataType() {
    return 'list';
  }

but AFAICT this should be field_config_base!

Why? Because:

Steps to reproduce

N/A

Proposed resolution

  1. Investigate
  2. Tests + fix.

Per @borisson_ in #7

I discussed this at drupal dev days 2023. We think that this is actually not an issue. The call to getDataType here is actually about the content of what is in the field, not about the field itself. Since all (or at least most) fields are lists, returning list here is correct.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

🐛 Bug report
Status

Fixed

Version

10.1

Component
Field 

Last updated about 17 hours ago

Created by

🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

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

Comments & Activities

Production build 0.69.0 2024