From 8641c469e38c994b5880600161df17c4c18c8744 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Mon, 26 Jan 2015 15:00:58 -0400 Subject: [PATCH] Avoid watchdogging "Cache rebuild lock hit: event_islandora_*" stuff. --- includes/utilities.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/utilities.inc b/includes/utilities.inc index 1459b0a5..4786e362 100644 --- a/includes/utilities.inc +++ b/includes/utilities.inc @@ -197,11 +197,14 @@ function islandora_invoke_hook_list($hook, array $refinements, array $args) { $return = array_merge_recursive($return, $result); array_shift($args); } - if (module_exists('rules') && $event = rules_get_cache("event_$hook")) { - $parameters = $event->parameterInfo(); - $rule_args = array_slice($args, 0, count($parameters)); - array_unshift($rule_args, $hook); - $result = call_user_func_array('rules_invoke_event', $rule_args); + if (module_exists('rules')) { + $event_info = rules_get_event_info($hook); + if (isset($event_info['module'])) { + $parameters = $event_info['variables']; + $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; }