diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc index f6ee8a2..6c498be 100644 --- a/core/modules/field/field.crud.inc +++ b/core/modules/field/field.crud.inc @@ -533,12 +533,21 @@ function field_create_instance(&$instance) { * - entity_type: The type of the entity the field is attached to. * - bundle: The bundle this field belongs to. * - field_name: The name of an existing field. - * Read-only ID properties are assigned automatically. Any other properties - * properties specified in $instance overwrite the existing values for - * the instance. + * Read-only ID properties are assigned automatically. Any other properties + * specified or omitted in $instance overwrite the existing values for the + * instance of the field. To preserve the existing field properties and make + * specific changes, first load the field definition with field_info_instance(): + * @code + * $instance_info = field_info_instance($entity_type, $field_name, $bundle_name); + * // Change a single property + * $instance_info['definition']['required'] = true; + * // Write the change back + * field_update_instance($instance_info['definition']); + * @endcode * * @throws Drupal\field\FieldException * + * @see field_info_instance() * @see field_create_instance() */ function field_update_instance($instance) {