You are here

function pmnote_update_7300 in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pmnote/pmnote.install \pmnote_update_7300()

Add entityreference_prepopulate behaviour to pmnote_parent.

File

pmnote/pmnote.install, line 72
Functions for the PM Note module.

Code

function pmnote_update_7300() {
  $entity_type = 'node';
  $field_name = 'pmnote_parent';
  $bundle_name = 'pmnote';

  // Get defaults from the configurations.
  module_load_include('inc', 'pmnote', 'includes/pmnote.field_instance');
  $field_instances = pmnote_default_field_instances();
  $field_instance = $field_instances['node-pmnote-pmnote_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);
}