Active
Project:
Domain Variable
Version:
7.x-1.1
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 May 2013 at 12:19 UTC
Updated:
7 Oct 2015 at 17:52 UTC
Jump to comment: Most recent
Hi!
I'm trying to use Domain Variable together with Domain Conf and Domain Settings, but these are apparently incompatible - http://drupal.org/node/1894988#comment-6975920 - so if Domain Variable is enabled, domain specific settings can't be used - variable_get will always retrieve the default values instead of domain specific ones.
I can't figure out why this is the case, and wonder if there is something that can be fixed as I would really like to use both simultaneously to manage domain specific settings on system forms in a number of third-party modules that doesn't use the Variable API?
Comments
Comment #1
bforchhammer commentedDomain Variable was specifically built to replace Domain Settings + Domain Configuration, and personally I'm not really interested in making them compatible... I'd also be happy to look at patches of course, but I won't work on it.
Which third-party modules are you talking about? Adding support for the Variable API is usually not too complicated, so maybe support can be added to them!?
In case you haven't seen it, here's a list of known differences between this module and domain conf/settings/theme.
Comment #2
bb_dogg commentedThanks for the quick reply!
I would like to use domain specific settings for any module that uses system_settings_form($form), in particular Google Analytics, Sitemap and a number of Drupal Commerce modules (Commerce Currency and Commerce Email for instance), which is what Domain Settings + Domain Configuration does.
I can't really figure out why Domain Variable causes these domain values not to be retrieved when using variable_get, as they are stored when saving the form, so perhaps you can point me in the right direction, and I'll have a go to if I can make them work together as I would really like to use them both?
Comment #3
bforchhammer commentedGoogle Analytics already has (at least partial) support for variable, see #1843960: Declare variables compatible with Domain Access; If you look at googleanalytics.variable.inc, you see everything that needs to be done when adding support: implement
hook_variable_info(), and set themultidomainkey toTRUE.You can also put the
hook_variable_info()implementation into your own module; so if any module owner doesn't want to implement the hook himself, you could do it in a separate module.Comment #4
bb_dogg commentedAlright, thanks, now I know how to proceed.
Comment #4.0
bb_dogg commentedIssue also related to Domain Settings
Comment #5
ngocketit commentedI think it's good to either keep the compatibility with Domain Conf or make the upgrade path module (now in sandbox) an official module or a feature of Domain Variable. I ran into situation where I needed to have different settings for different domains and languages. This module solves the issue perfectly but I was not confident enough to replace all the currently domain specific variables to use this new approach.
Comment #6
attisanwhat would we need to make these modules compatible? I still have the strong feeling that switching to domain variable won't fit my needs as there is such an overwhelming amount of modules not defining there varaibles in hook_variable_info let alone defining them as domain aware variables.
could someone point me into the right direct of source code to look at? I'm willing to sacrifice some of my time getting this one done
Comment #7
attisanmission state: accomplished. if anyone is interested I could set up a sandbox module.
under the hood: I have simply mimicked to domain_settings behavior (in fact, I'm attaching a new submit handler if domain_settings did so) and process the form data, pushing variables into the variable_store with variable_realm_set, variable_realm_get and variable_realm_del if needed.
works like a charm for me.
Comment #8
pwiniacki commented@attisan interesting, I would likely use you code to do some tests.
Comment #9
attisan@pwiniacki see https://www.drupal.org/sandbox/attisan/2535610
Comment #10
kerios83 commentedComment #11
attisan@kerios83 - fixed. sorry about that.