You are here

function panopoly_widgets_update_7022 in Panopoly Widgets 7

Mark important widget fields as required.

File

./panopoly_widgets.install, line 471
An installation file for Panopoly Widgets

Code

function panopoly_widgets_update_7022() {
  $required_bundle_fields = array(
    'basic_file' => array(
      'field_basic_file_file',
    ),
    'map' => array(
      'field_map_address',
    ),
    'quick_links' => array(
      'field_quick_links_links',
    ),
    'table' => array(
      'field_basic_table_table',
    ),
    'text' => array(
      'field_basic_text_text',
    ),
    'video' => array(
      'field_video_file',
    ),
  );
  foreach ($required_bundle_fields as $bundle => $required_fields) {
    foreach ($required_fields as $field_name) {
      $instance_info = field_info_instance('fieldable_panels_pane', $field_name, $bundle);
      $instance_info['required'] = 1;
      field_update_instance($instance_info);
    }
  }
}