Using a default aegir installation for multisites I get the following errors:

foo$ drush omega-subtheme "foo" html5 --destination=foo.bar
foo$ The destination is invalid.

Debugging includes/omega_tools.drush.inc shows me that the function omega_tools_sites() returns an array containing "[0] => all" when sites.php is empty.

As a temporary fix, I added foo.bar to sites.php, but I still get the error. Using the fix in http://drupal.org/node/1338932#comment-5233574 lets me successfully create the subtheme in sites/foo.bar/themes/foo.

I still think omega_tools_sites() should let me use destination without these extra measures though.

Comments

I am having the same issue. Thanks for showing me the workaround, I will try it out.

I, too, am having this issue.

Status:Active» Needs review
StatusFileSize
new849 bytes

Here's a patch against the 3.x-dev branch. The patch determines the sites available by doing a directory listing instead of reading from the sites.php file (which, as mentioned by the original poster, may not be available).

Also, the patch addresses the issue referenced by perarnet: http://drupal.org/node/1338932

It's my first Drupal patch submission. Constructive feedback is welcomed!

P.S. Great theme!

Status:Needs review» Needs work

´´

+++ b/omega_tools.moduleundefined
@@ -467,14 +467,17 @@ function omega_tools_sites() {
+
+    // Find all the directories in the sites directory
+    $DH = opendir(DRUPAL_ROOT . '/sites');
+    while($dir = readdir($DH)) {
+      if ($dir !== '.' && $dir !== '..' && is_dir(DRUPAL_ROOT . "/sites/$dir") ) {
+        $sites[] = $dir;
+      }
     }
-
-    $sites = array('all') + array_values($sites);
+    closedir($DH);
   }
-

Lets see if we can come up with a better solution than reading out the directories on the system. There could be anything in there and it doesn't have to be a valid site folder.

Hi Fubhy,

Ideally, there should be a core function that returns a list of valid sites. We know from Aegir that the sites.php is not reliable source of valid sites. Do you (or anyone else) have other suggestions?

Thanks,

Jim

I would agree that something like this needs to be integrated... I've done a ton of multisite builds without ever touching a sites.php...

Not sure the best solution though. I tend to sometimes just generate my theme to sites/all/themes, and then move it where i need it to go. not elegant, but there it is. :)

Post #6 is what I ended up doing as well. Would be nice to have the 'destination' option work, but its just one extra command and only have to do it once per site, as Aegir will keep the subtheme in the right folder when migrating from platform to platform.

As a workaround, is it possible for Omega tools to have a 'move sub-theme' option? So it would install the subtheme in 'sites/all/themes' and then move the subtheme to 'sites/foo.bar/themes' afterwards? (Only for the lazy of course =)

What exactly is the semantics of "--destination"? Is it a site subdirectory (c.f., drush site-install --sites-subdir ...) or a valid site installation (i.e., with settings.php)?

Perhaps the answer to this question should guide the proper solution.

StatusFileSize
new512 bytes

I've added a fix for this issue around sites.php.

Please see attached.

Status:Needs work» Needs review

Patch in #9 worked fine with my Aegir installation.

I tested the patch in #9 and it solved my problems after I added them to sites.php

I have created 3 multi-site without any default site.

I would be nice not to have to type them in the sites.php file