Closed (fixed)
Project:
Domain 8
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2013 at 15:32 UTC
Updated:
12 Jul 2013 at 14:41 UTC
Jump to comment: Most recent file
There is a new context system in core. See https://drupal.org/node/1928922
We need to figure our how we want to leverage that, and likely replace Domain Conf / Domain Settings with a new Domain Config module.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | config-context-1929144-9.patch | 5.27 KB | bforchhammer |
| #7 | config-context-1929144-7.patch | 4.92 KB | bforchhammer |
| #7 | domain.config.one_drupal8_dev.system.site.yml | 40 bytes | bforchhammer |
Comments
Comment #1
agentrickardSee \Drupal\locale\LocaleConfigSubscriber
Comment #2
dave reidHere's a context system I wrote to allow config overrides per hostname, it should only need to be adopted a little bit for actual domain records: http://privatepaste.com/ca7c77271f
Comment #3
podarokwow, nice
thanks!!
Comment #4
dave reidI should also note, this works for reading the configuration files, but I'm not sure how the config actually gets written.
Comment #5
podarok#4 looks like nope
commited refactored http://drupalcode.org/sandbox/podarok/1917942.git/commit/c1d1f534b7ff6f0... here
and http://drupalcode.org/sandbox/podarok/1917942.git/blob/c1d1f534b7ff6f09f... this 2 functions calls brokes config system.
Will looks at the code tomorrow and fix it
Comment #6
podarokEDIT: fixed
looks like it was container dic compiling issue.
Regeneration helps me
#2Can You explain how Your subscriber defined at Bundle?
Cause I`ve got error
Fatal error: Call to a member function get() on a non-object in \core\includes\config.inc on line 105about
Looks like there are no yet anyconfig.contextandconfig.loadat this stageThe code with commented lines hereComment #7
bforchhammer commentedWow, this works quite nicely :-)
Here's a cleaned up version of #2 and #5 against the sandbox...
Once applied, copy a config file into
sites/default/config_XX/active) and prefix the filename with e.g.domain.config.one_drupal8_dev.(whereone_drupal8_devis the machine name of a domain); then change some variables (e.g. the site name), clear the cache, and you should see your variables have a different value depending on the active domain.I tested this with the sitename variable and system.site.yml.
What's still missing is a way to set config values via the UI. I think core's locale module has the same problem, and it looks like this is going to be solved in contrib via the config_translation module; maybe that can serve as inspiration.
Eventually this should also consider "domain x language" combinations; i.e. we need to figure out how to allow values which are both domain-specific and multilingual. Conceptually we might be able to borrow ideas for that from the domain variable module, which tries to solve the same thing for D7.
Comment #8
agentrickardBefore we get too far down this path, I'd like to check that we have our classes in order. Specifically, we should look at the services we provide. Here's the current yml:
From an architecture pov, we also want the Config handler in a separate, optional module, like it is in previous versions.
Domain Config seems the proper name for that module (replacing Domain Conf.)
Comment #9
bforchhammer commentedWhat do you mean? They seem fine to me; they both make sense to me at least. I guess the subscriber would not need to be "exposed as a service", but from what I understand this is the standard way to register event subscribers in D8, right?
Attached patch moves everything into a separate module named Domain Config. Not sure whether the namespace is the correct one, but everything should still work the same.
Comment #10
agentrickardBumping. Nice work.
Comment #11
agentrickardI had to clean up the class naming a bit, but this has been committed.