You are here

function entity_translation_test_form_alter in Entity Translation 7

Implements hook_form_alter().

File

tests/entity_translation_test.module, line 11
Testing functionality for Entity Translation module.

Code

function entity_translation_test_form_alter(&$form, &$form_state) {
  if ($info = entity_translation_edit_form_info($form, $form_state)) {
    $handler = entity_translation_get_handler($info['entity type'], $info['entity']);
    if (entity_translation_enabled($info['entity type'], $info['entity'])) {
      $form_state['no_cache'] = $handler
        ->isNewEntity() && variable_get('entity_translation_test_disable_form_cache', FALSE);
    }
  }
}