You are here

function pmissue_update_7302 in Drupal PM (Project Management) 7.3

Change the widget used for Related and Parent issue to autocomplete.

File

pmissue/pmissue.install, line 115
Install, disable, uninstall and update functions for PM Issue module.

Code

function pmissue_update_7302() {
  $entity_type = 'node';
  $bundle_name = 'pmissue';

  // Get defaults from the configurations.
  module_load_include('inc', 'pmissue', 'includes/pmissue.field_base');
  module_load_include('inc', 'pmissue', 'includes/pmissue.field_instance');
  $field_bases = pmissue_default_field_bases();
  $field_instances = pmissue_default_field_instances();
  $field_name = 'pmissue_parent_issue';
  $field_instance = $field_instances['node-pmissue-' . $field_name];
  $instance_info = field_info_instance($entity_type, $field_name, $bundle_name);
  $instance_info['widget'] = $field_instance['widget'];
  field_update_instance($instance_info);
  $field_name = 'pmissue_related';
  $field_instance = $field_instances['node-pmissue-' . $field_name];
  $instance_info = field_info_instance($entity_type, $field_name, $bundle_name);
  $instance_info['widget'] = $field_instance['widget'];
  field_update_instance($instance_info);
}