(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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

samhassell’s picture

Status: Active » Needs review
anarcat’s picture

Status: Needs review » Needs work

Please 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.

adrian’s picture

this should be in provision core.

the color module is a core module.

samhassell’s picture

Title: Color module paths not updated during site deployment » Color module & theme logo/favicon paths not updated during site deployment
Status: Needs work » Needs review
FileSize
1.33 KB

Hey 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.

adrian’s picture

this 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.

anarcat’s picture

Status: Needs review » Fixed

I don't know what happened, but that patch is unapplicable:

patching file deploy.inc
patch: **** malformed patch at line 30:

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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 231c473 on debian, dev-migrate_aliases, prod-koumbit, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by anarcat:
    #791262 - update color and theme paths during deploy