function resource_conflict_field_delete_instance in Resource Conflict 7.3
Implements hook_field_delete_instance().
If this field was assigned as an RC date field, we want to delete it's data from our registry and possibly warn the user that RC was disabled for this content type.
File
- ./
resource_conflict.module, line 342 - Provides general functionality for the resource conflict module.
Code
function resource_conflict_field_delete_instance($instance) {
$rc_date_field = variable_get('rc_date_field_' . $instance['bundle'], FALSE);
if ($rc_date_field == $instance['field_name']) {
variable_del('rc_date_field_' . $instance['bundle']);
// Msg user if the content type was enabled for RC.
$content_type_enabled = variable_get('rc_type_' . $instance['bundle'], FALSE);
if ($content_type_enabled == 1) {
$msg = t('Resource Conflict has been disabled for the %type content type as the date field has been deleted.', array(
'%type' => $instance['bundle'],
));
drupal_set_message($msg, 'warning');
watchdog('resource conflict', $msg, WATCHDOG_WARNING);
}
// Delete the reg values for this content type whether it was enabled or
// not.
_resource_conflict_remove_type($instance['bundle']);
}
}