You are here

function _node_convert_recreate_identifiers in Node Convert 7

Utility function to recreate identifiers.

1 call to _node_convert_recreate_identifiers()
node_convert_update_7001 in ./node_convert.install
Create machine names for all node conversion templates.

File

./node_convert.module, line 525

Code

function _node_convert_recreate_identifiers() {

  // Migrate the conversion templates so they have a unique identifier.
  $result = db_select(NODE_CONVERT_TEMPLATE_TABLE, 'n')
    ->fields('n')
    ->execute();
  $rows = array();
  foreach ($result as $row) {
    $row->machine_name = $row->source_type . '_to_' . $row->destination_type . '_' . $row->nctid;
    $rows[] = $row;
  }
  foreach ($rows as $row) {
    drupal_write_record(NODE_CONVERT_TEMPLATE_TABLE, $row, array(
      'nctid',
    ));
  }
}