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

bforchhammer’s picture

Domain 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.

[...] 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?

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.

bb_dogg’s picture

Thanks 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?

bforchhammer’s picture

Google 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 the multidomain key to TRUE.

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.

bb_dogg’s picture

Alright, thanks, now I know how to proceed.

bb_dogg’s picture

Issue summary: View changes

Issue also related to Domain Settings

ngocketit’s picture

Issue summary: View changes

I 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.

attisan’s picture

Version: 7.x-1.0 » 7.x-1.1
Component: Miscellaneous » Code
Priority: Normal » Major

what 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

attisan’s picture

mission 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.

pwiniacki’s picture

@attisan interesting, I would likely use you code to do some tests.

attisan’s picture

kerios83’s picture

From git://git.drupal.org/sandbox/attisan/2535610
 * [new branch]      7.x-1.x    -> origin/7.x-1.x
fatal: Couldn't find remote ref HEAD
attisan’s picture

@kerios83 - fixed. sorry about that.