Browse Source

Merge pull request #580 from adam-vessey/7.x-rules-fix

Minor improvement and fix.
pull/581/head
William Panting 10 years ago
parent
commit
1c10195547
  1. 13
      includes/utilities.inc

13
includes/utilities.inc

@ -197,11 +197,14 @@ function islandora_invoke_hook_list($hook, array $refinements, array $args) {
$return = array_merge_recursive($return, $result); $return = array_merge_recursive($return, $result);
array_shift($args); array_shift($args);
} }
if (module_exists('rules') && $event = rules_get_cache("event_$hook")) { if (module_exists('rules')) {
$parameters = $event->parameterInfo(); $event_info = rules_get_event_info($hook);
$rule_args = array_slice($args, 0, count($parameters)); if (isset($event_info['module'])) {
array_unshift($rule_args, $hook); $parameters = $event_info['variables'];
$result = call_user_func_array('rules_invoke_event', $rule_args); $rule_args = array_slice($args, 0, count($parameters));
array_unshift($rule_args, $hook);
$result = call_user_func_array('rules_invoke_event', $rule_args);
}
} }
return $return; return $return;
} }

Loading…
Cancel
Save