function pmexpense_migrate in Drupal PM (Project Management) 7.2
Same name and namespace in other branches
- 8 pmexpense/includes/pmexpense.migrate.inc \pmexpense_migrate()
- 7.3 pmexpense/includes/pmexpense.migrate.inc \pmexpense_migrate()
Helper function for migrating between pmexpense to drupal fields.
1 call to pmexpense_migrate()
- pmexpense_update_7200 in pmexpense/
pmexpense.install - Migrate PM Expense nodes to field_api fields.
File
- pmexpense/
includes/ pmexpense.migrate.inc, line 12 - Migration functions for the PM Expense module.
Code
function pmexpense_migrate(&$sandbox) {
pmexpense_migrate_create_fields($sandbox);
// Migrate data from pmexpense node to Drupal user account.
if (empty($sandbox['pmexpense_current_vid_of_field_being_migrated'])) {
$sandbox['pmexpense_current_vid_of_field_being_migrated'] = 0;
}
if (pmexpense_migrate_field_data($sandbox) == FALSE) {
$sandbox['#finished'] = 0.5;
return;
}
// We don't need pmexpense table anymore, so dropping it.
db_drop_table('pmexpense');
variable_del('node_options_pmexpense');
// PM Permissions default configurations.
variable_set('pmpermission_field_parent_reference_for_pmexpense', 'pmexpense_parent');
variable_set('pmpermission_node_pmexpense_enabled', TRUE);
module_load_include('inc', 'pmpermission', 'includes/pmpermission.migrate');
pmpermission_migrate_execute('pmexpense');
$sandbox['#finished'] = 1;
return 'PM Note nodes have been migrated to field_api based fields successfully.';
}