1 image.install image_update_1003()

Add labels to all available styles.

Related topics

File

core/modules/image/image.install, line 241
Install, update and uninstall functions for the image module.

Code

function image_update_1003() {
  $names = config_get_names_with_prefix('image.style.');
  foreach ($names as $config_file) {
    $config = config($config_file);
    $label = $config->get('label');
    if (!$label) {
      $config->set('label', $config->get('name'));
      $config->save();
    }
  }
  cache('cache')->delete('image_styles');
}