Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared settings files for multisite #2989

Closed
shelane opened this issue Aug 2, 2018 · 4 comments
Closed

shared settings files for multisite #2989

shelane opened this issue Aug 2, 2018 · 4 comments
Labels
Bug Something isn't working

Comments

@shelane
Copy link
Contributor

shelane commented Aug 2, 2018

According to the /vendor/acquia/blt/settings/blt.settings.php, any settings.php files in /docroot/sites/settings will be included. I created a base.settings.php and a shared.settings.php file in that location. When the command blt blt:init:settings is run, it does indeed included them, but it treats the /docroot/sites/settings as if it's a multisite and adds all the other settings files in that directory so it looks like:

+-_settings
|  +-- _settings
|   | +-- default.local.settings.php
|   | +-- local.settings.php
| +-- base.settings.php
| +-- default.local.drush.yml
| +-- default.settings.php
| +-- local.drush.yml
| +-- settings.php
| +-- shared.settings.php

How do I have a "shared settings" directory without getting it turned into a "site" directory?

@dpagini
Copy link
Contributor

dpagini commented Aug 2, 2018

Hey @shelane. I think there's probably room for a code fix to ensure that a folder named settings is ignored in multisite, but for the time being, you can explicitly specify your multisite-sites in the blt/blt.yml file like below...

multisites:
  - default
  - site1
  - site2
  # - settings

Obviously you don't have to include settings here, and site1 and site2 are the names of your multisite directories.

@ba66e77 ba66e77 added 9.1.x Bug Something isn't working labels Aug 4, 2018
@ba66e77
Copy link
Contributor

ba66e77 commented Aug 4, 2018

I'm going to have to play with this to replicate and make sure I grok what is happening, but sure sounds like a bug.

@ba66e77
Copy link
Contributor

ba66e77 commented Aug 5, 2018

I confirmed the reported behavior and put in a PR that fixes it. The problem is that when a multisites array is not defined in config BLT presumes all directories in docroot/sites (with the exception of the special g directory used by ACSF) are multisites. So the quick fix is to add settings to the list of directories it ignores.

I'm torn though as to if this is really the best approach. Maybe instead what we should do is explicitly populate the multisites config array with default when you create a BLT project and add to the array with each invocation of blt recipes:multisite:init. I like that there'd be less 'magic' happening in that approach and everything would be explicit rather than implicit, but I don't know what secondary effects that might have.

@ba66e77
Copy link
Contributor

ba66e77 commented Aug 5, 2018

I've created #2995 as an enhancement to propose discussing/reworking the handling of multisites. That's a bigger chunk of work that I want to commit to in order to solve this immediate problem.

@dpagini , @shelane, can y'all test out PR #2994 and let me know if you see any issues with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants