You are here

function content_update_1001 in Content Construction Kit (CCK) 5

Copy node_type_content table back to core node_type table

File

./content.install, line 361

Code

function content_update_1001() {
  $ret = array();
  if (db_table_exists('node_type_content')) {
    $result = db_query("SELECT type_name, label, description, help, title_label FROM {node_type_content}");
    while ($data = db_fetch_object($result)) {
      $ret[] = update_sql("INSERT INTO {node_type}\n         (type, name, module, description, help, has_title, title_label, has_body, body_label, custom, orig_type, min_word_count)\n           VALUES ('" . db_escape_string($data->type_name) . "', '" . db_escape_string($data->label) . "', 'node', '" . db_escape_string($data->description) . "', '" . db_escape_string($data->help) . "', 1, '" . db_escape_string($data->title_label) . "', 0, '', 1, '" . db_escape_string($data->type_name) . "', 0)");
    }
    $ret[] = update_sql("DROP TABLE {node_type_content}");
    $ret[] = update_sql('DELETE FROM {cache}');
  }
  return $ret;
}