Since clone renames the site, it breaks Drupal which expects the themes and modules to be in a certain place. So after the site is cloned, the target site should rebuild its caches and the theme registry.

The workaround to unbreak sites is to use:

drush eval "drupal_rebuild_theme_registry();"

module_rebuild_cache() would also need to be ran.

Maybe it is simply a matter of running the "clear" at the end, but unfortunatly, at this point, the old drupal platform is partially bootstrapped and it's impossible to bootstrap in the next platform. Maybe triggering a verify, which should rebuild the theme registry would be sufficient, however, in my experience, it doesn't actually suffice, maybe because drupal_rebuild_theme_registry() isn't explicitely called. So maybe this call needs to be added to clear.inc too.

For the record, I tried the following patch:

diff --git a/platform/clone.provision.inc b/platform/clone.provision.inc
index 52a751c..66c4ee4 100644
--- a/platform/clone.provision.inc
+++ b/platform/clone.provision.inc
@@ -39,3 +39,7 @@ function drush_provision_drupal_provision_clone($url, $new_url, $platform = null
     'web_host' => drush_get_option('web_host'), 'web_ip' => drush_get_option('web_ip'), 
     'db_host' => drush_get_option('db_host'), 'master_db_host' => drush_get_option('master_db_host'), 'master_db_user' => drush_get_option('master_db_user'), 'master_db_passwd' => drush_get_option('mas
 }
+
+function drush_provision_drupal_post_provision_clone($url, $new_url, $platform = null) {
+  drush_include_engine('drupal', 'clear');
+}

But this aborts with:

Fatal error: Call to undefined function cache_clear_all() in /srv/aegir/.drush/provision/platform/drupal/clear.inc on line 7

... because the drupal is not bootstrapped far enough.

Comments

anarcat’s picture

Title: modules and theme registry needs to be rebuilt after clone » modules and theme registry needs to be rebuilt during deploy
Status: Active » Fixed

This was fixed by calling drupal_rebuild_theme_registry() in clear.inc. This issue is not specific to clone, but to deploy.

Status: Fixed » Closed (fixed)

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

  • Commit c74e3a2 on debian, dev-dns, dev-envobject, dev-koumbit, dev-log_directory, dev-migrate_aliases, dev-multiserver-install, dev-newhooks, dev-nginx, dev-platform_management, dev-ports, dev-purgebackup, dev-restore, dev-services, dev-simplerinstaller, dev-site_rename, dev-ssl, dev_716166_apache_conf, dev_dns, dev_server_verify, prod-koumbit, ssl, 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 authored by anarcat:
    #612246 rebuild the theme registry when clearing the caches