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. 7
      includes/utilities.inc

7
includes/utilities.inc

@ -197,12 +197,15 @@ 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);
if (isset($event_info['module'])) {
$parameters = $event_info['variables'];
$rule_args = array_slice($args, 0, count($parameters)); $rule_args = array_slice($args, 0, count($parameters));
array_unshift($rule_args, $hook); array_unshift($rule_args, $hook);
$result = call_user_func_array('rules_invoke_event', $rule_args); $result = call_user_func_array('rules_invoke_event', $rule_args);
} }
}
return $return; return $return;
} }

Loading…
Cancel
Save