You are here

function invite_by_email_update_7002 in Invite 7.4

Implements hook_update_N().

Update field instance info for email subject and body if empty set default value.

File

modules/invite_by_email/invite_by_email.install, line 221
Install, update and uninstall functions for the Invite by e-mail.

Code

function invite_by_email_update_7002(&$sandbox) {
  $instance_info = field_info_instance('invite', 'field_invitation_email_subject', 'invite_by_email');
  if (empty($instance_info['default_value'][0]['value'])) {
    $instance_info['default_value'][0]['value'] = variable_get('invite_default_mail_subject', '');
  }
  field_update_instance($instance_info);
  $instance_info = field_info_instance('invite', 'field_invitation_email_body', 'invite_by_email');
  if (empty($instance_info['default_value'][0]['value'])) {
    $instance_info['default_value'][0]['value'] = variable_get('invite_default_mail_body', '');
  }
  field_update_instance($instance_info);
}