diff --git a/platform/drupal/deploy.inc b/platform/drupal/deploy.inc index 06ee37231b380833c7891afe6ff756246c551c06..68f1d63f569e8ee0019e3c5e9cb82651c8eb473c 100644 --- a/platform/drupal/deploy.inc +++ b/platform/drupal/deploy.inc @@ -20,3 +20,27 @@ db_query("UPDATE {users} SET picture = replace(picture, 'sites/%s', 'sites/%s')" variable_set('file_directory_path', "sites/$new_url/files"); variable_set('file_directory_temp', "sites/$new_url/files/tmp"); +// Global theme settings paths. +if ($var = variable_get('theme_settings', FALSE)) { + $var['logo_path'] = str_replace($old_url, $new_url, $var['logo_path']); + $var['favicon_path'] = str_replace($old_url, $new_url, $var['favicon_path']); + variable_set('theme_settings', $var); +} + +$themes = list_themes(); +foreach (array_keys($themes) as $theme) { + // Update logo and favicon paths for each theme. + if ($var = variable_get('theme_'. $theme .'_settings', FALSE)) { + $var['logo_path'] = str_replace($old_url, $new_url, $var['logo_path']); + $var['favicon_path'] = str_replace($old_url, $new_url, $var['favicon_path']); + variable_set('theme_'. $theme .'_settings', $var); + } + // Update color module paths. + if (module_exists('color')) { + foreach (array('_files', '_logo', '_screenshot', '_stylesheets') as $suffix) { + if ($var = variable_get('color_'. $theme . $suffix, FALSE)) { + variable_set('color_'. $theme . $suffix, str_replace($old_url, $new_url, $var)); + } + } + } +}