function hook_field_update_field

Act on a field being updated.

This hook lets modules react to the update of an existing field. It is called after the definition is saved, so it cannot be used to modify the field itself.

Parameters

$field: The field as it is post-update.

$prior_field: The field as it was pre-update.

$has_data: Whether any data already exists for this field.

Related topics

3 functions implement hook_field_update_field()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

entity_reference_field_update_field in drupal/core/modules/entity_reference/entity_reference.module
Implements hook_field_update_field().
image_field_update_field in drupal/core/modules/image/image.module
Implements hook_field_update_field().
options_field_update_field in drupal/core/modules/options/options.module
Implements hook_field_update_field().
1 invocation of hook_field_update_field()
Field::saveUpdated in drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php
Saves an updated field definition.

File

drupal/core/modules/field/field.api.php, line 1903

Code

function hook_field_update_field($field, $prior_field, $has_data) {

  // Reset the static value that keeps track of allowed values for list fields.
  drupal_static_reset('list_allowed_values');
}