Change record status: 
Project: 
Introduced in branch: 
10.2.x
Introduced in version: 
10.2.0
Description: 

This change affects field config entities (field.field.*), field storage config entities (field.storage.*) and base field overrides (core.base_field_override.*).

Previously, it was possible to save any of these entities with an incomplete set of settings. For example, if creating a file field, you did not have to specify all the settings of the file field type (which includes things like file_extensions, max_filesize, file_directory, and so forth).

This sort of thing was allowed:

use Drupal\field\Entity\FieldConfig;

$field = FieldConfig::create([
  'entity_type' => 'node',
  'bundle' => 'page',
  'field_name' => 'field_uploads',
  'type' => 'file',
]);
// The settings are completely overwritten, and the missing ones are populated on save.
$field->set('settings', ['file_extensions' => 'txt webp']);
$field->save();

In Drupal 10.2 and later, it's no longer allowed to save field entities without all of their settings present (even if they only have their default values). The above code will now fill in the missing values automatically, and if a field entity is saved with an incomplete set of values - which should never happen under normal circumstances - an exception will be thrown.

Impacts: 
Module developers