You are here

function field_placeholder_update_7101 in Field placeholder 7

Same name and namespace in other branches
  1. 7.2 field_placeholder.install \field_placeholder_update_7101()

Update placement of placeholder in $instance for i18n_field integration.

File

./field_placeholder.install, line 11
Contains update functions for Field placeholder.

Code

function field_placeholder_update_7101() {
  $all_instances = field_info_instances();
  foreach ($all_instances as $entity_type => $bundle) {
    foreach ($bundle as $name => $instances) {
      foreach ($instances as $instance) {
        if (isset($instance['settings']['placeholder'])) {
          $instance['placeholder'] = $instance['settings']['placeholder'];
          unset($instance['settings']['placeholder']);
          field_update_instance($instance);
        }
      }
    }
  }
  return t('Field placeholder maintenance tasks finished');
}