function pmteam_migrate in Drupal PM (Project Management) 8
Same name and namespace in other branches
- 7.3 pmteam/includes/pmteam.migrate.inc \pmteam_migrate()
- 7.2 pmteam/includes/pmteam.migrate.inc \pmteam_migrate()
Helper function for migrating between PMTeam to drupal fields.
1 call to pmteam_migrate()
- pmteam_update_7103 in pmteam/
pmteam.install - Migrate PM Team nodes to field_api fields.
File
- pmteam/
includes/ pmteam.migrate.inc, line 12 - Migration functions for the PM Team module.
Code
function pmteam_migrate(&$sandbox) {
pmteam_migrate_create_fields($sandbox);
// Migrate data from pmteam node to Drupal user account.
if (empty($sandbox['pmteam_current_vid_of_field_being_migrated'])) {
$sandbox['pmteam_current_vid_of_field_being_migrated'] = 0;
}
if (pmteam_migrate_field_data($sandbox) == FALSE) {
$sandbox['#finished'] = 0.5;
return;
}
// We don't need pmteam table anymore, so dropping it.
db_drop_table('pmteam');
variable_del('node_options_pmteam');
module_load_include('inc', 'pm', 'includes/pm.permission.migrate');
pm_permission_migrate_execute('pmteam');
$sandbox['#finished'] = 1;
return 'PM Team nodes have been migrated to field_api based fields successfully.';
}