diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php index 8cb0e0c..123885b 100644 --- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php @@ -212,6 +212,9 @@ public function getDefaultValue(EntityInterface $entity); /** * Returns the field schema. * + * Note that this method returns an empty array for computed fields which have + * no schema. + * * @return array * The field schema, as an array of key/value pairs in the format returned * by hook_field_schema(): diff --git a/core/lib/Drupal/Core/Field/FieldItemInterface.php b/core/lib/Drupal/Core/Field/FieldItemInterface.php index 3a5db0e..bb1c5e5 100644 --- a/core/lib/Drupal/Core/Field/FieldItemInterface.php +++ b/core/lib/Drupal/Core/Field/FieldItemInterface.php @@ -30,13 +30,14 @@ * creation of the field. FieldItemInterface objects instantiated at that * time are not reliable as field instance settings might be missing. * - * Computed fields should return an empty array. + * Computed fields having no schema should return an empty array. * * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition * The field definition. * * @return array - * An associative array with the following key/value pairs: + * An empty array if there is no schema, or an associative array with the + * following key/value pairs: * - columns: An array of Schema API column specifications, keyed by column * name. The columns need to be a subset of the properties defined in * getPropertyDefinitions(). It is recommended to avoid having the column