You are here

function drafty_enforce_field_attach_submit in Drafty 7

Implements hook_field_attach_submit().

File

modules/drafty_enforce/drafty_enforce.module, line 11
Hook implementations and API functions for Drafty Enforce module.

Code

function drafty_enforce_field_attach_submit($entity_type, $entity, $form, &$form_state) {

  // Only force a draft revision when the entity form is submitted.
  $info = entity_get_info();
  if (!empty($info[$entity_type]['entity keys']['revision']) && !drafty_entity_is_new($entity, $entity_type)) {
    $entity->is_draft_revision = TRUE;
  }
}