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

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

Debugging includes/ 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 to sites.php, but I still get the error. Using the fix in lets me successfully create the subtheme in sites/

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

Members fund testing for the Drupal project. Drupal Association Learn more


mengi’s picture

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

GuyPaddock’s picture

I, too, am having this issue.

jtse’s picture

Status: Active » Needs review
849 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:

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

P.S. Great theme!

fubhy’s picture

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.

jtse’s picture

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?



himerus’s picture

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. :)

mengi’s picture

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/' afterwards? (Only for the lazy of course =)

jtse’s picture

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.

Paul Kim Consulting’s picture

512 bytes

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

Please see attached.

Paul Kim Consulting’s picture

Status: Needs work » Needs review
jlab’s picture

Patch in #9 worked fine with my Aegir installation.

kristofferwiklund’s picture

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

joelcollinsdc’s picture

Issue summary: View changes

I updated the patch in #3 on a sandbox project i'm workign on.

This module seems unmaintained so I am having trouble merging all the requisite patches...