--- admin.module 2010-01-26 19:12:38.000000000 -0500 +++ admin.module.patched 2010-01-26 19:08:38.000000000 -0500 @@ -590,8 +590,19 @@ function _admin_theme_rebuild($force = F $theme->info = system_theme_default(); $theme->info['name'] = 'Slate'; - db_query("DELETE FROM {system} WHERE name = 'slate' AND type = 'theme'"); - db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0); + if (!$exists) { + db_query("INSERT INTO {system} (name, owner, info, type, filename, status, throttle, bootstrap) VALUES ('%s', '%s', '%s', '%s', '%s', %d, %d, %d)", $theme->name, $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0); + } + else { + db_query("UPDATE {system} SET owner = '%s', + info = '%s', + type = '%s', + filename = '%s', + status = '%s', + throttle = '%s', + bootstrap = '%s' + WHERE name = '%s'", $theme->owner, serialize($theme->info), 'theme', $theme->filename, isset($theme->status) ? $theme->status : 0, 0, 0, $theme->name); + } variable_set('admin_theme_invalidated', FALSE); }