Change record status: 
Project: 
Introduced in branch: 
8.x
Introduced in version: 
8.0
Description: 

Configuration entities like field (instance) settings are stored using the configuration system. Settings are field type specific. Previously it was not possible to store settings differently from their runtime representation but there are various reasons to do so. One was that allowed field values for float and string list fields may contain dots, which are not allowed in the format the field settings used to be stored in configuration.

A new system for altering configuration entity values was added to allow for separate formats for storage when the runtime structure would not be possible to store in configuration as-is and the stored configuration would be too convoluted at runtime. Use mapFromStorageRecords(array $records) (was already available) to map from storage structures to entity instantiation data and mapToStorageRecord(EntityInterface $entity) (newly added) to map to configuration from runtime entity data.

Field (instance) configuration implements these methods and provides more granular methods for field type specific setting modifications. The following methods were added to field types to support massaging their configuration for/from storage:

  • public static function settingsToConfigData(array $settings);
  • public static function settingsFromConfigData(array $settings);
  • public static function instanceSettingsToConfigData(array $settings);
  • public static function instanceSettingsFromConfigData(array $settings);

For more on how field settings use this, read https://www.drupal.org/node/2297369

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done