image_entity_presave

function image_entity_presave

image_entity_presave(EntityInterface $entity)

Implements hook_entity_presave().

Transforms default image of image field from array into single value at save.

File

core/modules/image/image.module, line 339
Exposes global functionality for creating image styles.

Code

function image_entity_presave(EntityInterface $entity) {
  // Get the default image settings, return if not saving an image field storage
  // or image field entity.
  $default_image = [];
  if (($entity instanceof FieldStorageConfigInterface || $entity instanceof FieldConfigInterfac