You are here

function pmticket_update_7300 in Drupal PM (Project Management) 8

Same name and namespace in other branches
  1. 7.3 pmticket/pmticket.install \pmticket_update_7300()

Add entityreference_prepopulate behaviour to pmticket_parent.

File

pmticket/pmticket.install, line 74
Installation functions for the Project Management project module.

Code

function pmticket_update_7300() {
  $entity_type = 'node';
  $field_name = 'pmticket_parent';
  $bundle_name = 'pmticket';

  // Get defaults from the configurations.
  module_load_include('inc', 'pmticket', 'includes/pmticket.field_instance');
  $field_instances = pmticket_default_field_instances();
  $field_instance = $field_instances['node-pmticket-pmticket_parent'];
  $instance_info = field_info_instance($entity_type, $field_name, $bundle_name);
  $instance_info['settings']['behaviors']['prepopulate'] = $field_instance['settings']['behaviors']['prepopulate'];
  $instance_info['default_value_function'] = $field_instance['default_value_function'];
  field_update_instance($instance_info);
}