You are here

function entity_translation_delete_confirm_submit in Entity Translation 7

Submit handler for the translation deletion confirmation.

File

./entity_translation.admin.inc, line 487
The entity translation user interface.

Code

function entity_translation_delete_confirm_submit($form, &$form_state) {
  $handler = $form['#handler'];
  $entity_type = $form['#entity_type'];
  $entity = $form['#entity'];
  $langcode = $form['#language'];

  // Some modules expect the original values to be present when updating the
  // field values. Since we are deleting the translation no value has changed.
  $entity->original = $entity;

  // Remove the translation entry and the related fields.
  $handler
    ->removeTranslation($langcode);
  entity_translation_entity_save($entity_type, $entity);
  $form_state['redirect'] = $handler
    ->getTranslatePath();
}