When trying to clone a site with drush provision it disables all themes on the site claiming that they're incompatible. The themes are definitely not incompatible and I think the reason could be to do with the location of them as they're in profiles//themes.
The command I'm running is:
/usr/bin/php /home/aegir/drush/drush.php -v --root='/home/aegir/platforms/<platform1>' 'provision' 'clone' '<site>' '<cloned_site>' '/home/aegir/platforms/<platform2>'
When running it gives me:
<em>theme</em> <em>theme_name</em> is incompatible with this release of Drupal, and will be disabled. [warning]
For each theme enabled on the original site. It then sets the status of all of my themes to 0 in the system table.
Prior to it getting to the theme issue though, drush prints out some warning messages:
Undefined index: profiles [notice]
array_keys(): The first argument should be an array [warning]
Undefined index: [notice]
array_merge(): Argument #2 is not an array [warning]
Undefined index: modules [notice]
Invalid argument supplied for foreach() [warning]
Any ideas? is this being caused because my themes are within my install profile?
Comments
Comment #1
Anonymous (not verified) commentedIt very well could be.
If your target platform does not contain suitable dependencies to match that of the existing platform, and the themes/modules aren't in the /sites/$site/{modules,themes} directories of the site (this would avoid the problem, but is a poor workflow as it means it can't handle upgrades), then they will be disabled.
The idea is that you generate a 'build' or a platform containing the profile that has the relevant dependencies, and then you migrate or clone a site onto it. Aegir won't clone any part of the codebase other than the site in the sites/ directory.
Drush_Make is the perfect tool for generating your new platform using your install profile and a makefile to fetch the relevant dependencies into /profiles/themes etc.
Aegir allows you to perform the migration/clone because it won't make the assumption that the modules *should* be there, only notifies you that they're missing (they would appear as missing in the clone form if using the frontend to execute the clone task). It will only *prevent* a migration or a clone if there is an older version of the dependency on the target platform.
Hope that makes sense.
Comment #2
hadsie commentedYeah, that makes sense. Except for that both platforms are identical. I'm just testing right now to try and debug what's going on. I would think that if the themes have no problem working on the one platform then they should clone find to a platform with the identical code.
Comment #3
hadsie commentedOk, so I looked into this a bit more, and it looks like the problem is happening in drush's update_check_incompatibility() function. When drush_get_themes() is called, it fails to find any of the themes in my install profile. Should I move all my themes to the sites/all folder?
It seems like it should work with my themes in the profile though, as the modules are picked up no problem, and they're also in the profile, not sites/all.
After going through the code, it seems like it comes to drupal_system_listing() in common.inc. But when it checks for the theme incompatibility the profile that the site is using hasn't been set yet. So the global $profile variable is still set to default, not my custom profile.
Should this maybe this should be in the drush issue queue?
Comment #4
hadsie commentedYeah, this definitely seems to be caused by _system_theme_data() being called before the global $profile variable is set. When it's run again (at which point $profile is set appropriately) in update_check_incompatibility() in drush then the static themes_info variable (in the system_theme_data()) is not updated with the new themes it could find in the profiles folder.
Comment #5
adrian commentedAegir sets the global $profile and the $conf['install_profile'] in the settings.php, so it should work.
Comment #6
adrian commentedthis should work.
please confirm.
Comment #7
hadsie commentedthis looks to be working now. Thanks! :)