function _content_migrate_batch in Content Construction Kit (CCK) 7.3
Helper function to create a batch.
1 call to _content_migrate_batch()
- content_migrate_select_submit in modules/
content_migrate/ includes/ content_migrate.admin.inc - Submit handler.
File
- modules/
content_migrate/ includes/ content_migrate.admin.inc, line 201 - content_migrate.admin.inc Code to process field data migration, moved into a separate file for efficiency.
Code
function _content_migrate_batch($field_names) {
$batch = array(
'title' => t('Migrating data'),
'file' => drupal_get_path('module', 'content_migrate') . '/includes/content_migrate.admin.inc',
'operations' => array(),
'finished' => "Field migration is finished",
'init_message' => t("Fields migration is starting."),
'progress_message' => t('Processed @current out of @total.'),
'error_message' => t('Field migration has encountered an error.'),
);
// Migrate field data one field at a time.
foreach ($field_names as $field_name) {
$batch['operations'][] = array(
'_content_migrate_batch_process_create_fields',
array(
$field_name,
),
);
$batch['operations'][] = array(
'_content_migrate_batch_process_migrate_data',
array(
$field_name,
),
);
}
batch_set($batch);
}