Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
(using 0.4alpha7)
Color module doesn't use the file_directory_path variable, instead it uses the following variables:
- color_themename_files
- color_themename_logo
- color_themename_screenshot
- color_themename_stylesheets
As deploy doesn't update these, sites undergoing migration/cloning with color module enabled themes end up missing images and custom logos.
Here's a potential solution, based out of provision/platform/drupal/deploy.inc:
if (module_exists('color')) {
$themes = list_themes();
foreach (array_keys($themes) as $theme) {
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));
}
}
}
}
Heres another possibility:
// This updates only existing vars, but may catch other vars by accident. Less code and kinda fits with the other queries in that file.
$result = db_query("UPDATE {variable} SET value = (REPLACE (value, '%s', '%s')) WHERE name LIKE 'color_%'", array($old_name, $new_name));
Cheers,
Sam.
Comment | File | Size | Author |
---|---|---|---|
#4 | provision_791262_color_theme_varset.patch | 1.33 KB | samhassell |
Comments
Comment #1
samhassell CreditAttribution: samhassell commentedComment #2
anarcat CreditAttribution: anarcat commentedPlease provide a proper patch. See http://drupal.org/patch/create
I think it would be good to isolate this in a separate drush extension, the same way it was done with backup_migrate.
Comment #3
adrian CreditAttribution: adrian commentedthis should be in provision core.
the color module is a core module.
Comment #4
samhassell CreditAttribution: samhassell commentedHey guys,
Heres a patch for the above problem. I've also added in some code to fix the theme icons and favicon paths, which are also hard-coded.
The patch is rolled against the latest git.
I went for the longer, more precise patch.
Cheers,
Sam.
Comment #5
adrian CreditAttribution: adrian commentedthis looks good.
i know it's a pain in the ass, but we also officially still support drupal 5. and to keep in synch we might need the same code for drupal 7.
Comment #6
anarcat CreditAttribution: anarcat commentedI don't know what happened, but that patch is unapplicable:
Plus, there was a small error where it was mangling the values from favicon_path with the logo_path.
I have nevertheless committed a fixed version of the above patch to head.