The current way of saving the configuration for subdirs makes it impossible to generate configuration for sites in multi-level subdirectories.

This patch changes the file names so that it's possible to generate the configuration files, which seems to do the trick.

In order to make this work on the frontend, #2718715: Allow sites to be put in multi-level sub directories needs to be applied

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fabsor created an issue. See original summary.

fabsor’s picture

Issue summary: View changes
omega8cc’s picture

Hmm.. Have you tested how it will affect this logic?

  /**
   * Guess the URI this subdir alias is related too.
   */
  function uri() {
    $e = explode('/', $this->current_alias, 2);
    return $e[0];
  }

  /**
   * Guess the subdir part of the subdir alias.
   */
  function subdir() {
    $e = explode('/', $this->current_alias, 2);
    return $e[1];
  }
fabsor’s picture

Yes, that should still be there in order to generate the proper path in the configuration files, where we want to generate, like "Location /foo/bar"

The only issue that's blocking the current implementation from working with multi-level subdirs is that the configuration file is generated in the wrong location, since we have more than one / in the path. just replacing any / with _ in the path fixes that problem and from what I can see it seems to do the trick.

We are currently working on rolling this functionality out to a rather large aegir installation (100+ university sites). It's not done yet, so if you want to get some more test data, we can set this to postponed and I can get back to you when we know how it works out :)

omega8cc’s picture

OK, I will test this, but note that the patch is for Apache only. We need the same patch for provision/http/Provision/Config/Nginx/Subdir.php

omega8cc’s picture

Attached more complete patch to support also Nginx.

  • omega8cc committed 2db3f3b on 7.x-3.x
    Issue #2718711 by fabsor, omega8cc: Allow sites to be put in multi-level...
omega8cc’s picture

Status: Needs review » Fixed

Now it works! Thank you!

Status: Fixed » Closed (fixed)

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