ThemeKey contains an basic integration for the Domain Theme module. That integration should be migrated to Domain ThemeKey module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Loparev’s picture

Loparev’s picture

Category: Plan » Task
Status: Active » Needs review
Loparev’s picture

But I didn't understand how can I detect if this functionality was in use? One thing that I can is do something like this:

if (module_exists('domain_theme')) {
// show some warning
}

but module_exists() function checks if module installed and enabled. So, if this update will be launched when Domain Theme is disabled then user will not see this warning message.

I decided to show some warning message anyway.

mkalkbrenner’s picture

+++ b/themekey.install
@@ -569,9 +569,18 @@ function themekey_update_7104() {
-  return t('Update of ThemeKey ran successfully');
+  return t('Basic domain theme integration was moved to Domain ThemeKey module. Please install Domain ThemeKey module if you want get that functionality back. Update of ThemeKey ran successfully');

The additional information must not be shown to users that haven't installed domain_theme.

I recommend a different way to inform the user. Have a look at https://api.drupal.org/api/drupal/modules!system!system.api.php/function...

We should implement hook_requirements() and set a constraint on the 'update' phase:
if domain_theme is installed but domain_themekey is not, return REQUIREMENT_WARNING and a deteiled description.

I think we should not return REQUIREMENT_ERROR because there might be use cases, where users installed domain_theme and integrated it with themekey using themekey_compat but don't use domain specific theme settings. These people don't need domain_themekey.

That said, we can add a second constraint to the 'runtime' phase:
if the user activated domain specific settings but domain_themekey is not installed, return REQUIREMENT_ERROR.

mkalkbrenner’s picture

Status: Needs review » Needs work
Loparev’s picture

Loparev’s picture

Status: Needs work » Needs review

mkalkbrenner’s picture

Status: Needs review » Fixed

I adjusted the patch a little and committed it. Thanks.

Status: Fixed » Closed (fixed)

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