I've just installed Domain access and Domain rules.

I've set up a new rule with "After creating new domain" event, and 3 actions :
create a new node
show a message
and page redirect to [domain:url]

But when I create a new domain, none of it happends. Only a normal new domain creation.

Did I miss something ?
Thanks ;)

Comments

seren10pity’s picture

Ok,
I'm noob in patches etc, and in developpment too ^^
BUT :
I solved the broblem :D

In Domain Access 7.x-3.3,
hook_domainupdate($op, $domain = '', $form_values = array()){} doesn't exist,
But there is :

hook_domain_insert($domain = '', $form_values = array()){}
hook_domain_update($domain = '', $form_values = array()){}
hook_domain_delete($domain = '', $form_values = array()){}

So, in domain_rules.module, line 239, I replaced

/**
 * Implements hook_domainupdate()
 */
function domain_rules_domainupdate($op, $domain = '', $form_values = array()) {
  switch ($op) {
    case 'create':
      rules_invoke_event('domain_create', $domain);
      break;
    case 'update':
      rules_invoke_event('domain_update', $domain);
      break;
    case 'delete':
      rules_invoke_event('domain_delete', $domain);
      break;
  }
}

by

/**
 * Implements hook_domain_insert()
 */
function domain_rules_domain_insert($domain = '', $form_values = array()) {
	rules_invoke_event('domain_create', $domain);
}
/**
 * Implements hook_domain_update()
 */
function domain_rules_domainupdate($domain = '', $form_values = array()) {
  rules_invoke_event('domain_update', $domain);
}
/**
 * Implements hook_domain_delete()
 */
function domain_rules_domain_delete($domain = '', $form_values = array()) {
	rules_invoke_event('domain_delete', $domain);
}

And now, my rule is fireing !

Sorry, I tweaked it in dirty mode, and I didn't checked the other functions yet. But... I'm not developer, and I'm already proud having succeded to understand this minimum, and make it work by myself :p

I'd be very greatful if you can submit a new dev version of the module, with this properly done ;)

Thanks !

shushu’s picture

Assigned: Unassigned » shushu
Status: Active » Fixed

seren10pity, 10x !
Great work !
Sorry for the delay of handling this. Guess the move from D6 to D7 wasn't as good as I thought.

shushu’s picture

Version: 7.x-1.x-dev » 7.x-1.2
Status: Fixed » Closed (fixed)