You are here

function entity_translation_upgrade_start in Entity Translation 7

Starts the batch process to perform the upgrade.

1 call to entity_translation_upgrade_start()
entity_translation_upgrade_submit in entity_translation_upgrade/entity_translation_upgrade.module
Submit handler for the entity_translation_admin_form() form.

File

entity_translation_upgrade/entity_translation_upgrade.admin.inc, line 16
Converts node translations into field-based translations.

Code

function entity_translation_upgrade_start($types) {
  $batch = array(
    'operations' => array(
      array(
        'entity_translation_upgrade_do',
        array(
          $types,
        ),
      ),
      array(
        'entity_translation_upgrade_complete',
        array(),
      ),
    ),
    'finished' => 'entity_translation_upgrade_end',
    'title' => t('Entity Translation Upgrade'),
    'init_message' => t('Entity Translation Upgrade is starting.'),
    'error_message' => t('Entity Translation Upgrade has encountered an error.'),
    'file' => drupal_get_path('module', 'entity_translation_upgrade') . '/entity_translation_upgrade.admin.inc',
  );
  batch_set($batch);
  batch_process('admin/config/regional/entity_translation');
}